[FFmpeg-devel] [Patch] Use Transfer-Encoding: chunked (and perhaps PUT) for HTTP uploads
Mon Jan 4 10:01:12 CET 2010
On Sun, 2010-01-03 at 21:55 -0500, Ronald S. Bultje wrote:
> On Fri, Jan 1, 2010 at 5:10 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> > i think this is ok if tested unless we have some volunteer to maintain http.c
> > iam after all not ideal for the http maintainer role as i dont know the fine
> > details of it
> I can maintain.
> One thing:
> static int http_close(URLContext *h)
> + int ret;
> + char footer = "0\r\n\r\n";
> HTTPContext *s = h->priv_data;
> + /* signal end of chunked encoding if used */
> + if ((h->flags & URL_WRONLY) && s->chunksize != -1 &&
> + (ret = url_write(s->hd, footer, sizeof(footer) - 1)) < 0)
> + return ret;
> return 0;
> If it fails, you want to close it the more, and still return an error,
> no? If the write fails, this is a memleak.
Oops. I blame too much RAII as of late. Attached patch fixed. Any actual
error is returned (EIO most likely). Had to use ? : so http_close()
doesn't return positive values.
> (BTW why does close() have an error return value anyway?)
Because problems can occur while it is being called, such as an
interrupt. It seems at least EBADF, EINTR and EIO can occur. See
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2290 bytes
Desc: not available
More information about the ffmpeg-devel