On 10/13/2016 1:53 PM, Robert Klein wrote:
> Hi,
> 
> Mike <the.li...@mgm51.com> wrote:
>>
>> Diving into tcpdump, I found an important difference between httpd and
>> nginx.  
> 
> 
> See /usr/src/usr.sbin/httpd/server_fcgi.c
> 
> Transfer Encoding `chunked' is set for HTTP/1.1 in lines 389 and 390.
> 
> In lines 620 to 634 the Content-Length Header is removed. Note, if
> there is already another Transfer-Encoding set by the FastCGI, the
> connection is aborted (lines 553 to 559).
> 
> When looking at RFC2616 (HTTP/1.1) both versions seem to be valid (see
> section 14.3 for the Context-Length Header and section 4.4 `Message
> Length', paragraph 2 about Transfer-Encoding and paragraph three about
> mismatching(?) both.
> 
>> The difference between the two is that httpd does not include the
>> Content-length header that I specify in the php script, while nginx
>> does.
>>
>> Is there a way to encourage httpd to include the Content-length
>> header, or do I need to stay with nginx for this app?
> 
> Doesn't look this way at the moment.  If your C skills are better than
> mine, look at the lines in the server_fcgi.c file.
> 
> The FastCGI specifiction RFC 3875 part corresponding to HTTP Headers
> seems to be section 6.3, in this case especially subsection 4.  See the
> nginx forum post
> (https://forum.nginx.org/read.php?2,235985,235988#msg-235988) for an
> explanation.
> 

Hi Robert,

Many thanks for the quick reply.

My c skills are reasonable, but the time needed to dig through and learn
httpd source and the RFCs, and implement something useful, is not
currently available.

Unfortunately, the client in my scenario is an IoT device, as such, it
is immutable.  I have to deal with any quirks on the server side of things.

For now, I'm going to clean up the nginx conf and go with that until I
have the appropriate amount of time to investigate other options.

Thanks again for your reply.

Reply via email to