[FFmpeg-devel] Propose add 'Content-Length header to libavformat/http.c:http_connect

Ken kensystem
Fri Feb 13 06:55:47 CET 2009


Hi,

I wonder what opinions will be had regarding adding a content-length 
(with fake value, say 2^63) value to http_connect for POST operations; 
if not set by default, then by a command line arg.

The reason of course is that the absence of a Content-Length or 
Transfer-Encoding request-header is illegal to http 1.1 servers, so they 
instantly drop the request; however it is desirable to POST (or PUT or 
PATCH) data to a server from a live or transcode source (for types that 
support unbounded packetized stream,  e.g MPEGTS and FLV/AVI to an extent).

The ideal solution would be to POST with a Transfer-Encoding set to 
'chunked', although this is a) slightly more complex, and; b) would 
break compat with ffserver..

So, since the current request is already not http1.1 compliant, and b) 
adding the content length header should not harm ffserver, I would like 
to propose this change, or find one that has a similar effect.

Technically a declared length request will be considered in valid by 
most servers if the entire byte-range is not rcvd -- but API side code 
can still consume most or all of the input stream.

If another solution (similar to chunked encoding but without breaking 
ffserv) has been conceived, please let me know.

Regards,
Ken






More information about the ffmpeg-devel mailing list