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

Tomas Härdin tomas.hardin
Thu Dec 31 15:09:41 CET 2009


On Tue, 2009-12-22 at 13:56 +0000, Mans Rullgard wrote:
> 
> "Diego Biurrun" <diego at biurrun.de> wrote:
> 
> >On Tue, Dec 22, 2009 at 12:52:29PM +0000, Mans Rullgard wrote:
> >> 
> >> 
> >> "Diego Biurrun" <diego at biurrun.de> wrote:
> >> 
> >> >On Tue, Dec 22, 2009 at 01:22:07PM +0100, Tomas H?rdin wrote:
> >> >> 
> >> >> --- libavformat/http.c	(revision 20911)
> >> >> +++ libavformat/http.c	(working copy)
> >> >> @@ -344,13 +348,49 @@
> >> >> +
> >> >> +        if ((ret = url_write(s->hd, temp, strlen(temp))) < 0)
> >> >> +            return ret;
> >> >> +
> >> >> +        /* chunk-data */
> >> >> +        if ((ret = url_write(s->hd, buf, size)) < 0)
> >> >> +            return ret;
> >> >> +
> >> >> +        /* CRLF */
> >> >> +        if ((ret = url_write(s->hd, crlf, sizeof(crlf) - 1)) < 0)
> >> >> +            return ret;
> >> >
> >> >These if statements can be merged ..
> >> 
> >> No.
> >
> >Hehe, yes, but they can be compacted with 'else'. :)
> 
> That will hardly improve readability.

Sorry for not responding earlier, but I was up in the swedish mountains
bereft of internet access for a week during christmas.

It seems you can't quite agree on which style to use, so I made two more
patches with slightly different style. I'm attaching all four style
variants for this patch. Please pick one so I can post the other HTTP
patches.

In short, their differences are:

v1: original, not compacted
v2: compacted with || in http_write() and && in http_close()
v3: compacted with "else if" in http_write() and && in http_close()
v4: only compacted in http_close(), using &&

/Tomas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: http_1_chunked_v1.diff
Type: text/x-patch
Size: 2321 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091231/e2927fa0/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: http_1_chunked_v2.diff
Type: text/x-patch
Size: 2184 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091231/e2927fa0/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: http_1_chunked_v3.diff
Type: text/x-patch
Size: 2240 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091231/e2927fa0/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: http_1_chunked_v4.diff
Type: text/x-patch
Size: 2306 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091231/e2927fa0/attachment-0003.bin>



More information about the ffmpeg-devel mailing list