libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] POST with chunked encoding fails


From: Eivind Sarto
Subject: [libmicrohttpd] POST with chunked encoding fails
Date: Tue, 18 Dec 2012 14:33:53 -0500

I was was having problems receiving data from a client using POST with chunked 
encoding.
It turns out this client is violating the HTTP spec by setting the 
"Transfer-Encoding: Chunked"
as well as "Content-Length: 0"

Here are the client headers:
  POST /ee4/live.isml/Streams(Encoder1) HTTP/1.1
  Transfer-Encoding: Chunked
  User-Agent: ExpressionEncoder
  Host: 10.11.1.29
  Content-Length: 0
  Connection: Keep-Alive
  Cache-Control: no-cache

This is what HTTP 1.1 spec says (in section 4.4):
  Messages MUST NOT include both a Content-Length header field and a 
non-identity transfer-coding. If the message does include
  a non- identity transfer-coding, the Content-Length MUST be ignored.

libmicrohttpd does the opposite of what the 4.4 section says if both headers 
are present.  It only uses the content-length and ignores the
chunked encoding.
I patched libmicrohttpd with the attached patch that does the opposite.  It 
ignores the content-length if chunked encoding is also specified.
And with that patch libmicrohttpd can be a publishing point for MS Expression 
Encoder.

What is your take on this?

-eivind

Attachment: mhd.patch
Description: mhd.patch


reply via email to

[Prev in Thread] Current Thread [Next in Thread]