Return-Path: Delivered-To: apmail-tomcat-dev-archive@www.apache.org Received: (qmail 81495 invoked from network); 2 Jan 2006 18:03:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 2 Jan 2006 18:03:20 -0000 Received: (qmail 30131 invoked by uid 500); 2 Jan 2006 18:03:15 -0000 Delivered-To: apmail-tomcat-dev-archive@tomcat.apache.org Received: (qmail 30038 invoked by uid 500); 2 Jan 2006 18:03:15 -0000 Mailing-List: contact dev-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Developers List" Delivered-To: mailing list dev@tomcat.apache.org Received: (qmail 30027 invoked by uid 500); 2 Jan 2006 18:03:15 -0000 Delivered-To: apmail-jakarta-tomcat-dev@jakarta.apache.org Received: (qmail 30024 invoked by uid 99); 2 Jan 2006 18:03:15 -0000 X-ASF-Spam-Status: No, hits=0.6 required=10.0 tests=NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jan 2006 10:03:13 -0800 Received: by ajax.apache.org (Postfix, from userid 99) id A4392E0; Mon, 2 Jan 2006 19:02:52 +0100 (CET) From: bugzilla@apache.org To: tomcat-dev@jakarta.apache.org Subject: DO NOT REPLY [Bug 37285] - POST of document through CGI In-Reply-To: X-Bugzilla-Reason: AssignedTo Message-Id: <20060102180252.A4392E0@ajax.apache.org> Date: Mon, 2 Jan 2006 19:02:52 +0100 (CET) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG� RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND� INSERTED IN THE BUG DATABASE. http://issues.apache.org/bugzilla/show_bug.cgi?id=37285 ------- Additional Comments From rdevenezia@wildblue.net 2006-01-02 19:02 ------- Part of the problem is that CGIRunner.run has to deal with the feature of HttpServlet that does _not_ discriminate between POST and GET. I recall reading in passing somewhere, that HttpServlet will parse the POST contents into an internal data structure for enumeration via getParameterNames and retrieval via getParameterValue, if and only if the CONTENT_TYPE is "application/x-www-form-urlencoded". This act will likely drain the stdin and lose whatever original content was there. Additionally, the parameters parsed from the GET QUERY_STRING are thrown into the getParameterNames mix. In run(), when POST is observed, 1. stdin is read into a buffer named content. I speculated stdin is pre- drained if content type is urlencoded. 2. the HttpServlet parameters are written to the stream (S) that will be the cgis stdin. 3. the 'content' buffer is appended to S {buffer is empty if urlencoded and the whole thing if multipart form} One problem I see is that content length is not increased when content buffer is written. Maybe it gets measured elsewhere? My original foray into this bug is due to that fact I am deploying a cgi app (YaBB) that does not use standard parameter separators -- it's legacy nature has parameters being separated by & or ; . The cgi app was not getting the parameters it needed because HttpServlet encoded or escaped the semis and subsequent equals to their equivalent %{nn} forms. Since I can't recall the code numbers I'll use %.. For example: foo.pl?a=1&b=2;c=3;d=4 got HttpServlet parsed into parameters a=1 b=2%..c%..3%..d%..4 Things would be much cleaner if (presumably) HttpServlet did not automatically drain stdin, and then CGIServelt could output verbatim the POST contents to the cgis stdin and not fool around with looping over parsed out parameters. -- Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug, or are watching the assignee. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org For additional commands, e-mail: dev-help@tomcat.apache.org