[FFmpeg-devel] [PATCH] Replace old cookies with new cookies of the same name

Michael Niedermayer michaelni at gmx.at
Mon Aug 18 12:27:09 CEST 2014

On Mon, Aug 18, 2014 at 07:59:11PM +1000, Micah Galizia wrote:
> On Sun, Aug 17, 2014 at 9:29 PM, Nicolas George <george at nsup.org> wrote:
> > Le decadi 30 thermidor, an CCXXII, Micah Galizia a écrit :
> >> When new cookie values (with the same name as an existing cookie) are
> >> returned in an HLS stream, the current implementation will append the
> >> new cookie to the list of cookies. This causes FFMPEG to send multiple
> >> cookie values for the same cookie and in some cases exceed the http
> >> header size in some cases.
> >>
> >> The patch attached resolves the issue.
> >
> > Thanks for the patch. Below are a few technical remarks. But before that, a
> > general remark:
> >
> > char *cookies;  ///< holds newline (\n) delimited Set-Cookie header field
> >                      values (without the "Set-Cookie: " field name)
> >
> > Well, this is just awful. This is obviously not your fault, this is existing
> > code, but it is no way of building anything: it can do for a quick-and-dirty
> > first implementation to get things working, but it makes a very bad ground
> > to build upon.
> >
> > It seems to me that most of your patch is there to deal with that awful data
> > structure. A large part of the existing code too, for that matter.
> >
> > IMHO, it would be much better to rework the current code to use a proper
> > data structure. A dynarray of structures with name, value, path and domain
> > already split seems like the best option.
> >
> > I suspect it would even be simpler to do that than making sure your patch is
> > correct in its current form.
> >
> > Are you interested in that?
> Yes & no. I agree its not an ideal implementation (it actually was
> mine to begin with) to just use a string full of cookies. But we can't
> pass around complex structures through avopts, which is where we would

note, avopt now has AV_OPT_TYPE_DICT, dunno if that could help

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Those who are too smart to engage in politics are punished by being
governed by those who are dumber. -- Plato 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140818/2713cb35/attachment.asc>

More information about the ffmpeg-devel mailing list