You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Bill Kelley <ke...@windtraveller.com> on 1997/11/25 02:21:59 UTC

general/1477: Multipart form posting always fails

>Number:         1477
>Category:       general
>Synopsis:       Multipart form posting always fails
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    apache
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Mon Nov 24 17:30:00 PST 1997
>Last-Modified:
>Originator:     kelley@windtraveller.com
>Organization:
apache
>Release:        1.3b2
>Environment:
On Windows NT
>Description:
Multipart form postin fails, apparently due to Apache pipes being opened in TEXT mode instead of ...

#ifdef WIN32
#define enc_pipe(fds) _pipe(fds, 512, O_BINARY | O_NOINHERIT)
#else
                                                             ^^^^^^^^^^
                                                         was O_TEXT
which in turn adds a <CR> before each <LF>, which since in multipart
form postin, one of the delimiters sent by the browser (Netscape 3) for
multipart forms is a back to back <CR><LF><CR><LF>, which gets 
transmogrified (technical term :-) into  <CR><CR><LF><CR><CR><LF>
causing the CGI form parser not to find its delimiter.

There may have been some good reason for using O_TEXT, which causes
something someplace else to work, and if so, I'd REALLY appreciatte feedback to that effect. I'm using Apache on NT, and find it very fragile.
I have frequent hangs, apparently about a 24k memory leak per request,
and often leak about 2 file/pipe/whatever "handles" per request.
We worked around the resource "leaks" by asking apache to suicide every 10 requests, which seems absurdly soon. Otherwise we run out of file handles
at some point. Anyway, here is my attempt to fix an NT bug, and anyone with
suggestions on how to fix others would be very welcome to hear from.
>How-To-Repeat:
Send multipart form to apache on NT, the cgi script will not find
the separator.
>Fix:
See descriptio
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <ap...@Apache.Org> in the Cc line ]
[and leave the subject line UNCHANGED.  This is not done]
[automatically because of the potential for mail loops. ]