httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edgar Frank <>
Subject Re: [mod_fcgid] Feedback / Suggestions
Date Wed, 25 Nov 2009 10:37:35 GMT
2009/11/25 Graham Dumpleton <>
> 2009/11/25 Edgar Frank <>:
> > While delving into the FCGI and CGI spec, I encountered another reason not
> > to stream client data directly. CGI wants an explicitly set CONTENT_LENGTH
> > and FCGI enforces than rather obsoletes this (last sentence in 6.2 of the
> > FCGI spec).
> > If the client sends for any reason a message body with no CONTENT_LENGTH
> > set or CONTENT_LENGTH to be ignored as defined by RFC2616, you have to
> > read the full message body to determine the correct content length
> > which should be transferred to the backend.
> Things can get worse. Even if CONTENT_LENGTH is sent, if you have
> requests with compressed content which is decompressed by mod_deflate,
> the amount of content will not actually match what CONTENT_LENGTH says
> there will be as it reflects how things are before content is
> decompressed.

I implied this by originally meaning "read the full message body
through all input filters". Thanks for pointing this out.

> Don't know about FASTCGI in general, but for WSGI (Python higher level
> interface that can sit on CGI or FASTCGI) they have the stupid
> requirement that you take CONTENT_LENGTH as being precise and that you
> must not read more than CONTENT_LENGTH. If CONTENT_LENGTH isn't
> provided, WSGI says you are supposed to take it as meaning no data.
> [...]
> Anyway, don't know if this is at all relevant to FASTCGI. As you point
> out though, the CONTENT_LENGTH requirement does at least prevent
> FASTCGI from handling chunked request content. WSGI specification has
> same stupid limitation.

At least if you adhere strictly to the spec, you have to do it this way for
FastCGI, too. Although FastCGI provides the means to explicitly tell the
backend when the end-of-stream is hit.
I can't say if this is relevant in the real world, as there is still a chance
of more intelligent backends. I'll try it with PHP as soon as I find time for

Maybe, in implementing this in mod_fcgid and making it configurable, Apache
can serve more intelligent backends better.


View raw message