diff options
author | Matt Johnston <matt@ucc.asn.au> | 2015-02-28 23:49:39 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2015-02-28 23:49:39 +0800 |
commit | 3113932151b7d2358565e41c3f81f230436126c9 (patch) | |
tree | c30432481c871f8900e96eca9f94581527129cad /netio.c | |
parent | 125a970d71d5b43b7b648412fcc614e782c42a1d (diff) |
Better failure handling
Diffstat (limited to 'netio.c')
-rw-r--r-- | netio.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -169,11 +169,10 @@ struct dropbear_progress_connection *connect_remote(const char* remotehost, cons snprintf(c->errstring, len, "Error resolving '%s' port '%s'. %s", remotehost, remoteport, 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; } @@ -220,7 +219,7 @@ void handle_connect_fds(fd_set *writefd) { socklen_t vallen = sizeof(val); struct dropbear_progress_connection *c = iter->item; - if (!FD_ISSET(c->sock, writefd)) { + if (c->sock < 0 || !FD_ISSET(c->sock, writefd)) { continue; } |