nghttpx: Add SSL_read/write error logging

This commit is contained in:
Tatsuhiro Tsujikawa 2015-01-06 21:56:19 +09:00
parent f6097ce6d0
commit a6cf6c00ea
2 changed files with 33 additions and 19 deletions

View File

@ -250,6 +250,9 @@ int ClientHandler::read_tls() {
ev_timer_again(loop_, &wt_);
goto fin;
default:
if (LOG_ENABLED(INFO)) {
CLOG(INFO, this) << "SSL_read: SSL_get_error returned " << err;
}
return -1;
}
}
@ -298,6 +301,9 @@ int ClientHandler::write_tls() {
ev_timer_again(loop_, &wt_);
return 0;
default:
if (LOG_ENABLED(INFO)) {
CLOG(INFO, this) << "SSL_write: SSL_get_error returned " << err;
}
return -1;
}
}

View File

@ -1668,7 +1668,10 @@ int Http2Session::read_tls() {
rb_.reset();
struct iovec iov[2];
auto iovcnt = rb_.wiovec(iov);
if (iovcnt > 0) {
if (iovcnt == 0) {
return 0;
}
auto rv = SSL_read(ssl_, iov[0].iov_base, iov[0].iov_len);
if (rv == 0) {
@ -1685,6 +1688,9 @@ int Http2Session::read_tls() {
ev_timer_again(loop_, &wt_);
return 0;
default:
if (LOG_ENABLED(INFO)) {
SSLOG(INFO, this) << "SSL_read: SSL_get_error returned " << err;
}
return -1;
}
}
@ -1692,7 +1698,6 @@ int Http2Session::read_tls() {
rb_.write(rv);
}
}
}
int Http2Session::write_tls() {
ev_timer_again(loop_, &rt_);
@ -1721,6 +1726,9 @@ int Http2Session::write_tls() {
ev_timer_again(loop_, &wt_);
return 0;
default:
if (LOG_ENABLED(INFO)) {
SSLOG(INFO, this) << "SSL_write: SSL_get_error returned " << err;
}
return -1;
}
}