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

Tomas Härdin tomas.hardin
Tue Dec 22 13:50:03 CET 2009


On Tue, 2009-12-22 at 13:34 +0100, Diego Biurrun 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 ..
> 
> > +
> > +    /* signal end of chunked encoding if used */
> > +    if ((h->flags & URL_WRONLY) && s->chunksize != -1) {
> > +        if ((ret = url_write(s->hd, footer, sizeof(footer) - 1)) < 0)
> > +            return ret;
> 
> .. as can these two ..
> 
> Diego

Done.

/Tomas

-------------- 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/20091222/e6b3c73a/attachment.bin>



More information about the ffmpeg-devel mailing list