mirror of
https://github.com/moparisthebest/curl
synced 2024-12-21 23:58:49 -05:00
Use the was_iface variable when binding a socket locally, even if no
SO_BINDTODEVICE is present, to prevent compiler warnings about the variable
This commit is contained in:
parent
496bbceef1
commit
0d3aa8b7be
@ -244,23 +244,20 @@ static CURLcode bindlocal(struct connectdata *conn,
|
|||||||
|
|
||||||
if(h)
|
if(h)
|
||||||
was_iface = TRUE;
|
was_iface = TRUE;
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
if(strlen(data->set.device)>1) {
|
|
||||||
/*
|
|
||||||
* This was not an interface, resolve the name as a host name
|
|
||||||
* or IP number
|
|
||||||
*/
|
|
||||||
rc = Curl_resolv(conn, data->set.device, 0, &h);
|
|
||||||
if(rc == 1)
|
|
||||||
(void)Curl_wait_for_resolv(conn, &h);
|
|
||||||
|
|
||||||
if(h)
|
if(!was_iface) {
|
||||||
/* we know data->set.device is shorter than the myhost array */
|
/*
|
||||||
strcpy(myhost, data->set.device);
|
* This was not an interface, resolve the name as a host name
|
||||||
|
* or IP number
|
||||||
|
*/
|
||||||
|
rc = Curl_resolv(conn, data->set.device, 0, &h);
|
||||||
|
if(rc == 1)
|
||||||
|
(void)Curl_wait_for_resolv(conn, &h);
|
||||||
|
|
||||||
}
|
if(h)
|
||||||
|
/* we know data->set.device is shorter than the myhost array */
|
||||||
|
strcpy(myhost, data->set.device);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(! *myhost) {
|
if(! *myhost) {
|
||||||
|
Loading…
Reference in New Issue
Block a user