Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 72989 invoked from network); 6 Feb 2004 08:38:02 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 6 Feb 2004 08:38:02 -0000 Received: (qmail 56621 invoked by uid 500); 6 Feb 2004 08:37:23 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 56589 invoked by uid 500); 6 Feb 2004 08:37:23 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 56569 invoked by uid 500); 6 Feb 2004 08:37:23 -0000 Received: (qmail 56556 invoked from network); 6 Feb 2004 08:37:23 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 6 Feb 2004 08:37:22 -0000 Received: (qmail 72813 invoked by uid 1198); 6 Feb 2004 08:37:46 -0000 Date: 6 Feb 2004 08:37:46 -0000 Message-ID: <20040206083746.72812.qmail@minotaur.apache.org> From: hgomez@apache.org To: jakarta-tomcat-connectors-cvs@apache.org Subject: cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp_common.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N hgomez 2004/02/06 00:37:46 Modified: jk/native/common jk_ajp_common.c Log: More info to track the potential problem in POST recovery Revision Changes Path 1.46 +16 -9 jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c Index: jk_ajp_common.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp_common.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- jk_ajp_common.c 25 Jan 2004 23:51:41 -0000 1.45 +++ jk_ajp_common.c 6 Feb 2004 08:37:46 -0000 1.46 @@ -1007,6 +1007,7 @@ ajp_operation_t *op) { int err = 0; + int postlen; /* Up to now, we can recover */ op->recoverable = JK_TRUE; @@ -1074,18 +1075,23 @@ ae->left_bytes_to_send, jk_b_get_len(op->reply) - AJP_HEADER_LEN); /* - * POST recovery job is done here. - * It's not very fine to have posted data in reply but that's the only easy - * way to do that for now. Sharing the reply is really a bad solution but - * it will works for POST DATA less than 8k. + * POST recovery job is done here and will work when data to + * POST are less than 8k, since it's the maximum size of op-post buffer. * We send here the first part of data which was sent previously to the * remote Tomcat */ - if (jk_b_get_len(op->post) > AJP_HEADER_LEN) { + + /* Did we have something to resend (ie the op-post has been feeded previously */ + + postlen = jk_b_get_len(op->post); + if (postlen > AJP_HEADER_LEN) { if(!ajp_connection_tcp_send_message(ae, op->post, l)) { - jk_log(l, JK_LOG_ERROR, "Error resending request body\n"); + jk_log(l, JK_LOG_ERROR, "Error resending request body (%d)\n", postlen); return JK_FALSE; } + else + jk_log(l, JK_LOG_DEBUG, "Resent the request body (%d)\n", postlen); + } else { /* We never sent any POST data and we check if we have to send at @@ -1096,7 +1102,7 @@ /* || s->is_chunked - this can't be done here. The original protocol sends the first chunk of post data ( based on Content-Length ), and that's what the java side expects. - Sending this data for chunked would break other ajp13 serers. + Sending this data for chunked would break other ajp13 servers. Note that chunking will continue to work - using the normal read. */ @@ -1185,6 +1191,7 @@ jk_log(l, JK_LOG_INFO, "ERROR reading POST data from client. " "Connection aborted or network problems\n"); + return JK_CLIENT_ERROR; } break; @@ -1439,7 +1446,7 @@ p->worker->name, errno); } else { - jk_log(l, JK_LOG_ERROR, "In jk_endpoint_t::service, NULL parameters\n"); + jk_log(l, JK_LOG_ERROR, "ajp: end of service with error\n"); } return JK_FALSE; --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org