Author: mturk Date: Wed Nov 17 18:20:20 2010 New Revision: 1036153 URL: http://svn.apache.org/viewvc?rev=1036153&view=rev Log: Although jk_shutdown_socket preserves the errno across the call, use the error returned from the jk_tcp_socket_recvfull. This will make sure the rare ocasion with errno == 0 doesn't get unnoticed
Modified: tomcat/jk/trunk/native/common/jk_ajp_common.c Modified: tomcat/jk/trunk/native/common/jk_ajp_common.c URL: http://svn.apache.org/viewvc/tomcat/jk/trunk/native/common/jk_ajp_common.c?rev=1036153&r1=1036152&r2=1036153&view=diff ============================================================================== --- tomcat/jk/trunk/native/common/jk_ajp_common.c (original) +++ tomcat/jk/trunk/native/common/jk_ajp_common.c Wed Nov 17 18:20:20 2010 @@ -1211,8 +1211,8 @@ int ajp_connection_tcp_get_message(ajp_e /* If the return code is not negative */ /* then we always get back the correct number of bytes. */ if (rc < 0) { - ae->last_errno = errno; if (rc == JK_SOCKET_EOF) { + ae->last_errno = EPIPE; jk_log(l, JK_LOG_INFO, "(%s) can't receive the response header message from tomcat, " "tomcat (%s) has forced a connection close for socket %d", @@ -1220,6 +1220,7 @@ int ajp_connection_tcp_get_message(ajp_e ae->sd); } else { + ae->last_errno = -rc; jk_log(l, JK_LOG_INFO, "(%s) can't receive the response header message from tomcat, " "network problems or tomcat (%s) is down (errno=%d)", @@ -1300,8 +1301,8 @@ int ajp_connection_tcp_get_message(ajp_e /* If the return code is not negative */ /* then we always get back the correct number of bytes. */ if (rc < 0) { - ae->last_errno = errno; if (rc == JK_SOCKET_EOF) { + ae->last_errno = EPIPE; jk_log(l, JK_LOG_ERROR, "(%s) can't receive the response body message from tomcat, " "tomcat (%s) has forced a connection close for socket %d", @@ -1309,6 +1310,7 @@ int ajp_connection_tcp_get_message(ajp_e ae->sd); } else { + ae->last_errno = -rc; jk_log(l, JK_LOG_ERROR, "(%s) can't receive the response body message from tomcat, " "network problems or tomcat (%s) is down (errno=%d)", --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org