improve error-reporting (should fixed the Success 5 0 0 messages)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@693 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.6
Jan Kneschke 17 years ago
parent 6b63deb241
commit d00bb524f7
  1. 27
      src/network_openssl.c

@ -77,18 +77,33 @@ int network_write_chunkqueue_openssl(server *srv, connection *con, chunkqueue *c
*/
if ((r = SSL_write(con->ssl, offset, toSend)) <= 0) {
unsigned long err;
switch ((ssl_r = SSL_get_error(con->ssl, r))) {
case SSL_ERROR_WANT_WRITE:
break;
case SSL_ERROR_SYSCALL:
switch(errno) {
case EPIPE:
return -2;
default:
log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL:",
/* perhaps we have error waiting in our error-queue */
if (0 != (err = ERR_get_error())) {
log_error_write(srv, __FILE__, __LINE__, "sdds", "SSL:",
ssl_r, r,
ERR_error_string(err, NULL));
} else if (r == -1) {
/* no, but we have errno */
switch(errno) {
case EPIPE:
return -2;
default:
log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL:",
ssl_r, r, errno,
strerror(errno));
break;
}
} else {
/* neither error-queue nor errno ? */
log_error_write(srv, __FILE__, __LINE__, "sddds", "SSL (error):",
ssl_r, r, errno,
strerror(errno));
break;
}
return -1;

Loading…
Cancel
Save