[FFmpeg-devel] [PATCH]Add one CRLF to http headers if necessary

Nicolas George george at nsup.org
Thu Feb 26 17:04:22 CET 2015


L'octidi 8 ventôse, an CCXXIII, Derek Buitenhuis a écrit :
> I read it as a 'text stream', which isn't necessarily file i/o only, but I
> doubt it is worth bikeshedding over.

You are probably right, I meant "file" I/O in the Unix sense.

> I think relying on the user to input a CR+LF cia command line program is
> insane in the first place... shouldn't the library do that / join headers
> properly?

The major issue there is that the type of the "headers" option is really
"list of pairs of strings". The AVOption system does not have anything like
that, not even "list of strings", which would be the second best choice.

Lacking that, we have to use the next best type, "string", and require the
user to serialize the "list of pairs of strings" into a single string. And
since a line break is the only character that can not be present in the
header value, using it as delimiter is a sane choice.

Remember that we are talking about library API, not end-user interface.
CR+LF is not harder to insert than any other sequence of bytes.

If we are talking about end-user interface, the changes should happen in
cmdutils.c.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150226/d955aa5f/attachment.asc>


More information about the ffmpeg-devel mailing list