Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@apache.org Received: (qmail 80651 invoked from network); 21 May 2003 20:49:12 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 21 May 2003 20:49:12 -0000 Received: (qmail 16236 invoked by uid 97); 21 May 2003 20:51:24 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-dev@nagoya.betaversion.org Received: (qmail 16229 invoked from network); 21 May 2003 20:51:24 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 21 May 2003 20:51:24 -0000 Received: (qmail 79742 invoked by uid 500); 21 May 2003 20:49:02 -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 79731 invoked from network); 21 May 2003 20:49:01 -0000 Received: from mail07b.vwh1.net (209.238.9.59) by daedalus.apache.org with SMTP; 21 May 2003 20:49:01 -0000 Received: from www.workspeed.com (208.55.23.110) by mail07b.vwh1.net (RS ver 1.0.80vs) with SMTP id 0652008124 for ; Wed, 21 May 2003 16:15:25 -0400 (EDT) From: "Denis Goeury" To: Subject: mod_jk2 ignores ajp13 packets if they contain less than 5 bytes Date: Wed, 21 May 2003 16:15:32 -0400 Message-ID: <001401c31fd5$bbb78ed0$6500a8c0@workspeed.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.3416 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Loop-Detect: 1 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Environment ----------- Apache 2.0.45 Tomcat 4.1.24 mod_jk2 Symptom ------- mod_jk2 ignores ajp13 packets containing less than 5 bytes of data. Here is an example of an "ignored" packet containing a two characters string "ab". Byte Content Description 0 0x12 standard header 1 0x34 standard header 2 0x00 data length 3 0x04 data length 4 0x00 string length 5 0x02 string length 6 0x61 'a' 7 0x62 'b' My findings ----------- According to ajp13's documentation the packet's content is perfect. By looking to Tomcat's source code I found that JkInputStream.receive() checks the message's length and returns false if it is less than 5. Here is the source code: /** Receive a chunk of data. Called to implement the * 'special' packet in ajp13 and to receive the data * after we send a GET_BODY packet */ public boolean receive() throws IOException { ... if( bodyMsg.getLen() <= 4 ) { // just the header // Don't mark 'end of stream' for the first chunk. // end_of_stream = true; return false; } ... } It looks like JkInputStream.receive() thinks that MsgAjp.getLen() returns the total number of bytes in the packet when in fact it returns the data length (4 with the sample packet). This was confirmed by connecting a debugger to Tomcat. Question -------- Is that a bug in JkInputStream, in MsgAjp, or is there something wrong with my setup? Thanks in advance, Denis Goeury --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org