diff options
author | Matt Johnston <matt@ucc.asn.au> | 2015-03-03 20:53:00 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2015-03-03 20:53:00 +0800 |
commit | 5dff74109e566b3ed18298974c2d4d8afe6d817a (patch) | |
tree | 6d1bad28a60c04eca3b60e63635407047eb67922 /netio.c | |
parent | 20d970a0e2831b497ec68dd20099c7b4b9d53e19 (diff) |
Fix error handling for dbclient async connect
Diffstat (limited to 'netio.c')
-rw-r--r-- | netio.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -104,6 +104,8 @@ static void connect_try_next(struct dropbear_progress_connection *c) { message.msg_iovlen = iovlen; res = sendmsg(c->sock, &message, MSG_FASTOPEN); if (res < 0 && errno != EINPROGRESS) { + m_free(c->errstring); + c->errstring = m_strdup(strerror(errno)); /* Not entirely sure which kind of errors are normal - 2.6.32 seems to return EPIPE for any (nonblocking?) sendmsg(). just fall back */ TRACE(("sendmsg tcp_fastopen failed, falling back. %s", strerror(errno))); @@ -124,6 +126,8 @@ static void connect_try_next(struct dropbear_progress_connection *c) { if (res < 0 && errno != EINPROGRESS) { /* failure */ + m_free(c->errstring); + c->errstring = m_strdup(strerror(errno)); close(c->sock); c->sock = -1; continue; |