summaryrefslogtreecommitdiff
path: root/usr.sbin/nsd/xfrd-tcp.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/nsd/xfrd-tcp.c')
-rw-r--r--usr.sbin/nsd/xfrd-tcp.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/usr.sbin/nsd/xfrd-tcp.c b/usr.sbin/nsd/xfrd-tcp.c
index b5910b33e70..5b1d80bb514 100644
--- a/usr.sbin/nsd/xfrd-tcp.c
+++ b/usr.sbin/nsd/xfrd-tcp.c
@@ -1268,9 +1268,12 @@ conn_read_ssl(struct xfrd_tcp* tcp, SSL* ssl)
}
if(err == SSL_ERROR_ZERO_RETURN) {
/* EOF */
- return 0;
+ return -1;
}
- log_msg(LOG_ERR, "ssl_read returned error %d with received %zd", err, received);
+ if(err == SSL_ERROR_SYSCALL)
+ log_msg(LOG_ERR, "ssl_read returned error SSL_ERROR_SYSCALL with received %zd: %s", received, strerror(errno));
+ else
+ log_msg(LOG_ERR, "ssl_read returned error %d with received %zd", err, received);
}
if(received == -1) {
if(errno == EAGAIN || errno == EINTR) {
@@ -1317,9 +1320,12 @@ conn_read_ssl(struct xfrd_tcp* tcp, SSL* ssl)
int err = SSL_get_error(ssl, received);
if(err == SSL_ERROR_ZERO_RETURN) {
/* EOF */
- return 0;
+ return -1;
}
- log_msg(LOG_ERR, "ssl_read returned error %d with received %zd", err, received);
+ if(err == SSL_ERROR_SYSCALL)
+ log_msg(LOG_ERR, "ssl_read returned error SSL_ERROR_SYSCALL with received %zd: %s", received, strerror(errno));
+ else
+ log_msg(LOG_ERR, "ssl_read returned error %d with received %zd", err, received);
}
if(received == -1) {
if(errno == EAGAIN || errno == EINTR) {
@@ -1462,7 +1468,10 @@ xfrd_tcp_read(struct xfrd_tcp_pipeline* tp)
#endif
ret = conn_read(tcp);
if(ret == -1) {
- log_msg(LOG_ERR, "xfrd: failed reading tcp %s", strerror(errno));
+ if(errno != 0)
+ log_msg(LOG_ERR, "xfrd: failed reading tcp %s", strerror(errno));
+ else
+ log_msg(LOG_ERR, "xfrd: failed reading tcp: closed");
xfrd_tcp_pipe_stop(tp);
return;
}