[FFmpeg-soc] [PATCH] http refactoring

Martin Storsjö martin at martin.st
Wed Jun 2 09:01:09 CEST 2010


On Tue, 1 Jun 2010, Josh Allmann wrote:

> On 1 June 2010 15:22, Josh Allmann <joshua.allmann at gmail.com> wrote:
> >
> > The first patch separates the initialization from the actual
> > connection, which will enable delayed connections using the internal
> > api.
> >
> 
> Ignore this one (for now).
> 
> It  works within http.c, but not outside (eg, with rtsp) because
> there's no way to initialize the URLContext without calling url_open
> and hence http_open. Making http_open do delayed connections by
> default will break API behavior.

Exactly. What about making it work just as it does now, but adding e.g. 
some URL_DELAYOPEN flag, which changes its behaviour, which iirc Ronald 
suggested. Then you can do a normal url_open(..., URL_DELAYOPEN), set the 
custom headers and then open the actual connection?

Also, as for replacing/adding headers.. I'm not sure that you'd want to 
skip all of the default headers if you're adding custom ones, e.g. 
User-Agent, Accept and Host can very well be kept, perhaps Connection: 
close, too.

Ideally, the user code should be able to remove/replace these headers if 
it wants to, but use the default values if nothing is changed. But that 
requires a bit more complex data structure... Perhaps that's out of scope 
here, too.

// Martin


More information about the FFmpeg-soc mailing list