Commit 32f21661 authored by Pekka Ervasti's avatar Pekka Ervasti Committed by Pekka Niemimaa
Browse files

ts_engine/connectors: use current_srv_ip4addr when connecting


Signed-off-by: default avatarPekka Ervasti <pekka.ervasti@haltian.com>
parent 1243b4ab
......@@ -480,16 +480,13 @@ static int execute_http_request(struct sockaddr_in *srv_addr, uint16_t port, cha
return NETWORK_ERROR;
http_con_dbg("Connect to port %d ...\n", port);
srv_addr->sin_port = htons(port);
ret = connect(sock, (struct sockaddr *)srv_addr, sizeof(*srv_addr));
current_srv_ip4addr->sin_port = htons(port);
ret = connect(sock, (struct sockaddr *)current_srv_ip4addr, sizeof(*current_srv_ip4addr));
if (ret < 0)
{
if (srv_addr == current_srv_ip4addr)
{
/* Could not connect to server. Try updating server IP address on
* next try. */
memset(current_srv_ip4addr, 0, sizeof(*current_srv_ip4addr));
}
/* Could not connect to server. Try updating server IP address on
* next try. */
memset(current_srv_ip4addr, 0, sizeof(*current_srv_ip4addr));
goto err_close;
}
......
......@@ -480,16 +480,13 @@ static int execute_http_request(struct sockaddr_in *srv_addr, uint16_t port, cha
return NETWORK_ERROR;
http_con_dbg("Connect to port %d ...\n", port);
srv_addr->sin_port = htons(port);
ret = connect(sock, (struct sockaddr *)srv_addr, sizeof(*srv_addr));
current_srv_ip4addr->sin_port = htons(port);
ret = connect(sock, (struct sockaddr *)current_srv_ip4addr, sizeof(*current_srv_ip4addr));
if (ret < 0)
{
if (srv_addr == current_srv_ip4addr)
{
/* Could not connect to server. Try updating server IP address on
* next try. */
memset(current_srv_ip4addr, 0, sizeof(*current_srv_ip4addr));
}
/* Could not connect to server. Try updating server IP address on
* next try. */
memset(current_srv_ip4addr, 0, sizeof(*current_srv_ip4addr));
goto err_close;
}
......
......@@ -480,16 +480,13 @@ static int execute_http_request(struct sockaddr_in *srv_addr, uint16_t port, cha
return NETWORK_ERROR;
http_con_dbg("Connect to port %d ...\n", port);
srv_addr->sin_port = htons(port);
ret = connect(sock, (struct sockaddr *)srv_addr, sizeof(*srv_addr));
current_srv_ip4addr->sin_port = htons(port);
ret = connect(sock, (struct sockaddr *)current_srv_ip4addr, sizeof(*current_srv_ip4addr));
if (ret < 0)
{
if (srv_addr == current_srv_ip4addr)
{
/* Could not connect to server. Try updating server IP address on
* next try. */
memset(current_srv_ip4addr, 0, sizeof(*current_srv_ip4addr));
}
/* Could not connect to server. Try updating server IP address on
* next try. */
memset(current_srv_ip4addr, 0, sizeof(*current_srv_ip4addr));
goto err_close;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment