Bug 10178 - Proxy server cuts off begining of buffer when specific header is used.
Summary: Proxy server cuts off begining of buffer when specific header is used.
Status: RESOLVED WONTFIX
Alias: None
Product: Apache httpd-1.3
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: HEAD
Hardware: PC Linux
: P3 major with 1 vote (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2002-06-24 14:23 UTC by Fima Furman
Modified: 2007-08-02 11:17 UTC (History)
0 users



Attachments
Fix drop of leading line of response for non-http proxied responses (5.41 KB, patch)
2002-07-11 16:41 UTC, Jon Strabala
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fima Furman 2002-06-24 14:23:01 UTC
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> header causes 
proxy server to loose parts of buffer.

After upgrade to 1.3.26 our XML API stopped working and we isolated the 
following problem:

The following API XML response when passing through Proxy server:

<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?><response><Auth 
status="0"/><Version 
status="0"><number>1.61</number><url>http://release.openair1.com/download/OpenAi
rOffLine161.exe</url><size>1246882</size></Version><Read 
status="0"><Slip><type>T</type><description/><total>0.00</total><projectid/><tax
_location_name/><updated><Date><year>2002</year><minute>18</minute><second>35</s
econd><hour>10</hour><month>01</month><day>07</day></Date></updated><notes>Raz
Dva
Tri
Chetyre</notes><currency>USD</currency><total_with_tax/><categoryid/><rate>0.00<
/rate><payment_typeid/><userid>1</userid><gl_code>1234455454</gl_code><unitm/><i
d>11</id><timer_start/><minute/><projecttaskid/><created><Date><year>2000</year>
<minute>45</minute><second>53</second><hour>10</hour><month>11</month><day>17</d
ay></Date></created><cost>0.000</cost><city/><invoiceid/><itemid/><date><Date><y
ear>2000</year><minute/><second/><hour/><month>11</month><day>13</day></Date></d
ate><hour>4</hour><customerid>40</customerid><quantity>0.00</quantity></Slip></r
esponse>

would return nothing, or would cut off buffer returning only the end of the 
full response. When we tried to connect to webserver directly (bypassing 
proxy), the whole response was returned with no porblems. Then we tried putting 
a line break after initial:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>. As the result the 
whole response below that line was intact but this line got chewed off by 
proxy. Then we put the following sequence:
<?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> \n <?xml 
version="1.0" encoding="iso-8859-1" standalone="yes"?> <the rest of the 
response>

(Two identical headers with line break in between and then full response) The 
first header got chewed off, the second one remained there and the rest of the 
response was fine. This hack enabled us to get back to working API.

We can replicate this problem on all machines running new version of Apachi.
Comment 1 Jon Strabala 2002-07-11 16:41:26 UTC
Created attachment 2321 [details]
Fix drop of leading line of response for non-http proxied responses
Comment 2 Jon Strabala 2002-07-11 16:50:31 UTC
I have supplied a patch for correcting
this bug, basically if a non-HTTP response
is received 1.3.26 will drop the 1st line
even though it is not a header, refer to
my attachement for a non-certified quick
fix.  

The basic fix was to write a 'peek' function
to look at a line without consuming the
input buffer when checking for a true HTTP
header response to a proxied request.

I felt it was important to post it due 
to the inability to use 1.3.24 which 
doesn't have this bug - BUT has a nasty
security flaw i.e. the CERT chunk bug.
Comment 3 Jim Jagielski 2003-04-08 15:09:26 UTC
mod_proxy is not designed to be a generic, all-purpose proxy. We will investigate this 
patch, but it is likely not to be included in 1.3 in deference to 2.0.
Comment 4 Jeff Trawick 2003-11-21 22:42:08 UTC
enabling the PatchAvailable keyword
updated doc on submitting patches is at http://httpd.apache.org/dev/patches.html