From: Jim <li...@yg...> - 2005-05-23 06:19:02
|
This patch corrects a bug in the Read_Partial code used for handling SSL connections. I have previously described it in more detail. http://sourceforge.net/mailarchive/forum.php?thread_id=5425639&forum_id=2688 Unless anyone sees a problem with the patch, I would appreciate if someone with sufficient access could commit these changes. Same goes for the previous two patches that I just submitted. All of the patches were made against 3.2.0b6. Thanks. Jim --- htnet/orig_SSLConnection.cc 2005-05-22 22:40:34.780406291 -0600 +++ htnet/SSLConnection.cc 2005-05-22 22:39:22.603791916 -0600 @@ -131,18 +131,20 @@ int SSLConnection::Read_Partial(char *bu { errno = 0; - if (timeout_value > 0) { - FD_SET_T fds; - FD_ZERO(&fds); - FD_SET(sock, &fds); - - timeval tv; - tv.tv_sec = timeout_value; - tv.tv_usec = 0; - - int selected = select(sock+1, &fds, 0, 0, &tv); - if (selected <= 0) - need_io_stop++; + if (!SSL_pending(ssl)) { + if (timeout_value > 0) { + FD_SET_T fds; + FD_ZERO(&fds); + FD_SET(sock, &fds); + + timeval tv; + tv.tv_sec = timeout_value; + tv.tv_usec = 0; + + int selected = select(sock+1, &fds, 0, 0, &tv); + if (selected <= 0) + need_io_stop++; + } } if (!need_io_stop) |