[FFmpeg-devel] [Patch] Use Transfer-Encoding: chunked (and perhaps PUT) for HTTP uploads

Tomas Härdin tomas.hardin
Mon Dec 21 18:47:44 CET 2009

On Mon, 2009-12-21 at 10:48 -0500, Ronald S. Bultje wrote: 
> Hi Tomas,
> On Mon, Dec 21, 2009 at 8:58 AM, Tomas H?rdin <tomas.hardin at codemill.se> wrote:
> > To remedy this I added the flag "chunked_upload" to HTTPContext and
> > modified http_connect(), http_write() and http_close() appropriately.
> There's "chunksize" already, that should be sufficient (-1 if not
> chunked, set if chunked). Is there a specific reason why the new
> variable is needed?

I considered that, but I didn't think about URLContext::flags. Without
that there's no way to distinguish chunksize == 1 between "last chunk
was of size 1" from "we're using chunked encoding" in http_close() since
we don't know if we're uploading or downloading. Luckily I can simply
check for URL_WRONLY.

> I agree using POST is a little bit weird, but I disagree that it's
> wrong. Both are fine in different situations. The default should
> probably be PUT though, not POST.
> Ronald


I've attached a version which does not add anything to HTTPContext.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: http_put.diff
Type: text/x-patch
Size: 3414 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091221/29cc85fa/attachment.bin>

More information about the ffmpeg-devel mailing list