Index: jk_ajp_common.c =================================================================== --- jk_ajp_common.c (revision 494542) +++ jk_ajp_common.c (working copy) @@ -760,6 +760,7 @@ rc = select((int)ae->sd + 1, &rset, NULL, NULL, &tv); } while (rc < 0 && errno == EINTR); + ae->last_errno = 0; if (rc == 0) { /* Timeout. Set the errno to timeout */ #if defined(WIN32) || (defined(NETWARE) && defined(__NOVELL_LIBC__)) @@ -767,11 +768,13 @@ #else errno = ETIMEDOUT; #endif + ae->last_errno = errno; return JK_FALSE; } else if (rc < 0) { + ae->last_errno = errno; jk_log(l, JK_LOG_WARNING, - "error during select err=%d", errno); + "error during select, (errno=%d)", ae->last_errno); return JK_FALSE; } else @@ -872,7 +875,7 @@ jk_log(l, JK_LOG_INFO, "Failed opening socket to (%s) with (errno=%d)", - jk_dump_hinfo(&ae->worker->worker_inet_addr, buf), errno); + jk_dump_hinfo(&ae->worker->worker_inet_addr, buf), ae->last_errno); JK_TRACE_EXIT(l); return JK_FALSE; } @@ -947,9 +950,9 @@ else { jk_log(l, JK_LOG_ERROR, "(%s) can't receive the response message from tomcat, " - "network problems or tomcat is down (%s), err=%d", + "network problems or tomcat is down (%s), (errno=%d)", ae->worker->name, jk_dump_hinfo(&ae->worker->worker_inet_addr, - buf), rc); + buf), ae->last_errno); JK_TRACE_EXIT(l); } return JK_FALSE; @@ -1015,9 +1018,9 @@ ae->last_errno = errno; jk_log(l, JK_LOG_ERROR, "(%s) can't receive the response message from tomcat, " - "network problems or tomcat (%s) is down %d", + "network problems or tomcat (%s) is down, (errno=%d)", ae->worker->name, jk_dump_hinfo(&ae->worker->worker_inet_addr, buf), - rc); + ae->last_errno); JK_TRACE_EXIT(l); return JK_FALSE; } @@ -1544,8 +1547,8 @@ JK_FALSE) { jk_log(l, JK_LOG_ERROR, "(%s) Timeout with waiting reply from tomcat. " - "Tomcat is down, stopped or network problems.", - p->worker->name); + "Tomcat is down, stopped or network problems, (errno=%d)", + p->worker->name, p->last_errno); if (headeratclient == JK_FALSE) { if (p->worker->recovery_opts & RECOVER_ABORT_IF_TCGETREQUEST) op->recoverable = JK_FALSE;