The issue isn't really the limit, but the way Apache behaves when it encounters the limit. When Apache encounters the limit it still reads then entire incoming byte stream, even if its only throwing it away. That is as demanded by the HTTP protocol:
RFC 2616: http://www.w3.org/Protocols/rfc2616/rfc2616-sec8.html#sec8.2.3 Where it says: - If an origin server receives a request that does not include an Expect request-header field with the "100-continue" expectation, the request includes a request body, and the server responds with a final status code before reading the entire request body from the transport connection, then the server SHOULD NOT close the transport connection until it has read the entire request, or until the client closes the connection. Otherwise, the client might not reliably receive the response message. However, this requirement is not be construed as preventing a server from defending itself against denial-of-service attacks, or from badly broken client implementations. Amazingly neither Firefox nor IE send out this Expect header! So if I am to stay as a HTTP/1.1 compliant server I must read the entire body of the gigabyte file, even though I know its oversized and is to be ignored. Nevertheless, I want to make Apache do just that. I can't have folks waiting that long. How can I make it return a reply, stop reading and drop the connection? Brian On 10/23/06, Issac Goldstand <[EMAIL PROTECTED]> wrote:
Take a look at mod_apreq (http://httpd.apache.org/apreq/) Specifically,you may want to read http://www.mail-archive.com/[email protected]/msg00716.html Issac Brian McQueen wrote: > I need to be able to stop users from uploading a massive file > promptly/early. By the time the headers are read its already known > that the file will be too big, so I want to return at this point - > without delay. To wait until the body has been fully read can take > hours or days for massive files. The problem I am having is that > Apache has been so well designed in its protocol compliance, that I > can't seem to stop it from reading the rest of the request - the > entire massive body of the request! How can I make it return > immediately? I know the Expect header is the answer, but the lame > clients don't use the Expect header, and I'm talking about IE and > Firefox. The only client I've found that really works is curl! So I > need to get it to make it reply promptly and early and stop reading. > How can I do that? > > Brian
