mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Add error variable to loop condition
In case of connection errors before and during the handshake, net_select_result is retrying with the next address of the server. It however was immediately going to the last address as it was not checking the return value of try_connect for all intermediate addresses.
This commit is contained in:
parent
0249dd0a31
commit
4548f22b38
@ -1351,7 +1351,7 @@ static int net_select_result(int fd, int event)
|
|||||||
int err = errno;
|
int err = errno;
|
||||||
if (s->addr) {
|
if (s->addr) {
|
||||||
plug_log(s->plug, 1, s->addr, s->port, strerror(err), err);
|
plug_log(s->plug, 1, s->addr, s->port, strerror(err), err);
|
||||||
while (s->addr && sk_nextaddr(s->addr, &s->step)) {
|
while (err && s->addr && sk_nextaddr(s->addr, &s->step)) {
|
||||||
err = try_connect(s);
|
err = try_connect(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1580,7 +1580,7 @@ int select_result(WPARAM wParam, LPARAM lParam)
|
|||||||
if (s->addr) {
|
if (s->addr) {
|
||||||
plug_log(s->plug, 1, s->addr, s->port,
|
plug_log(s->plug, 1, s->addr, s->port,
|
||||||
winsock_error_string(err), err);
|
winsock_error_string(err), err);
|
||||||
while (s->addr && sk_nextaddr(s->addr, &s->step)) {
|
while (err && s->addr && sk_nextaddr(s->addr, &s->step)) {
|
||||||
err = try_connect(s);
|
err = try_connect(s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user