mirror of
https://github.com/clearml/dropbear
synced 2025-04-21 22:54:48 +00:00
Better failure handling
This commit is contained in:
parent
125a970d71
commit
3113932151
7
netio.c
7
netio.c
@ -169,10 +169,9 @@ struct dropbear_progress_connection *connect_remote(const char* remotehost, cons
|
|||||||
snprintf(c->errstring, len, "Error resolving '%s' port '%s'. %s",
|
snprintf(c->errstring, len, "Error resolving '%s' port '%s'. %s",
|
||||||
remotehost, remoteport, gai_strerror(err));
|
remotehost, remoteport, gai_strerror(err));
|
||||||
TRACE(("Error resolving: %s", gai_strerror(err)))
|
TRACE(("Error resolving: %s", gai_strerror(err)))
|
||||||
return NULL;
|
} else {
|
||||||
}
|
|
||||||
|
|
||||||
c->res_iter = c->res;
|
c->res_iter = c->res;
|
||||||
|
}
|
||||||
|
|
||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
@ -220,7 +219,7 @@ void handle_connect_fds(fd_set *writefd) {
|
|||||||
socklen_t vallen = sizeof(val);
|
socklen_t vallen = sizeof(val);
|
||||||
struct dropbear_progress_connection *c = iter->item;
|
struct dropbear_progress_connection *c = iter->item;
|
||||||
|
|
||||||
if (!FD_ISSET(c->sock, writefd)) {
|
if (c->sock < 0 || !FD_ISSET(c->sock, writefd)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user