From: Sebastian B. <sb...@us...> - 2014-02-21 06:38:34
|
Update of /cvsroot/simplemail/simplemail In directory sfp-cvs-1.v30.ch3.sourceforge.com:/tmp/cvs-serv25775 Modified Files: tcp.c Log Message: Forward more specifc error texts. Index: tcp.c =================================================================== RCS file: /cvsroot/simplemail/simplemail/tcp.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- tcp.c 21 Feb 2014 06:37:07 -0000 1.51 +++ tcp.c 21 Feb 2014 06:38:32 -0000 1.52 @@ -267,11 +267,29 @@ } else { int err = SSL_get_error(conn->ssl, rc); - char buf[64]; + char buf[128]; sm_snprintf(buf, sizeof(buf), "SSL_connect() failed with error %d", err); SM_DEBUGF(5,("%s\n", buf)); /* TODO: Implement and use proper error API */ tell_from_subtask(buf); + + switch (err) + { + case SSL_ERROR_SSL: + { + long err_code; + while ((err_code = ERR_get_error())) + { + char err_buf[120]; + + ERR_error_string_n(err_code, err_buf, sizeof(err_buf)); + + sm_snprintf(buf, sizeof(buf), "More specific error %d: %s", err_code, err_buf); + tell_from_subtask(buf); + } + } + break; + } } SSL_shutdown(conn->ssl); |