Fix bug: not destroy connection when peer closed

Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
main
Jianhui Zhao 2017-11-27 00:01:07 +08:00
parent 6e58dab2b8
commit 589df6a85b
1 changed files with 5 additions and 3 deletions

View File

@ -118,10 +118,12 @@ no_ssl:
if (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK)
return ret;
if (ret != 0) {
con->flags |= UH_CON_CLOSE;
if (ret != 0)
uh_log_err("read");
}
else
uh_log_debug("peer closed");
con->flags |= UH_CON_CLOSE;
}
return ret;
}