[FFmpeg-trac] #5460(ffmpeg:new): http.c module, custom headers are lost

FFmpeg trac at avcodec.org
Thu Apr 21 19:49:28 CEST 2016


#5460: http.c module, custom headers are lost
-------------------------------------+-------------------------------------
             Reporter:  kowalsky     |                     Type:  defect
               Status:  new          |                 Priority:  important
            Component:  ffmpeg       |                  Version:
             Keywords:  http         |  unspecified
  headers                            |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 Summary of the bug: using ffmpeg/ffplay passing multiples custom http
 headers only the user-agent and the last header are kept.
 All the other custom headers are ignored and substituted by the default
 ones.
 How to reproduce:

 ffmpeg -v debug -user-agent 'Mozilla/5.0 (X11; Linux x86_64; rv:45.0)
 Gecko/20100101 Firefox/45.0' -headers 'Accept:
 text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'$'\r\n'
 -headers 'Accept-Language: en-US,en;q=0.8,es-ES;q=0.5,es;q=0.3'$'\r\n'
 -headers 'Accept-Encoding: gzip, deflate'$'\r\n' -headers 'DNT: 1'$'\r\n'
 -headers 'Referer:
 http://www.ponlatv.com/jwplayer6/jwplayer.flash.swf'$'\r\n' -headers
 'Connection: keep-alive'$'\r\n' -i
 'http://cdn.sstream.pw/live/cuatro_xrf2a3/playlist.m3u8?st=8If-lp-
 putG5fQ_PAioD-Q&e=1460073969'  - | ffplay -

 This will produce the following  log:

 ffplay version 3.0.1ffmpeg version 3.0.1 Copyright (c) 2003-2016 the
 FFmpeg developers
  Copyright (c) 2000-2016 the FFmpeg developers
   built with gcc 4.9.2 (GCC)
   configuration: --enable-libfaac --enable-libx264 --enable-gpl --enable-
 nonfree --enable-ffplay --enable-sdl --enable-gnutls --enable-openssl
   built with gcc 4.9.2 (GCC)
   configuration: --enable-libfaac --enable-libx264 --enable-gpl --enable-
 nonfree --enable-ffplay --enable-sdl --enable-gnutls --enable-openssl
   libavutil      55. 17.103 / 55. 17.103
   libavutil      55. 17.103 / 55. 17.103
   libavcodec     57. 24.102 / 57. 24.102
   libavcodec     57. 24.102 / 57. 24.102
   libavformat    57. 25.100 / 57. 25.100
   libavformat    57. 25.100 / 57. 25.100
   libavdevice    57.  0.101 / 57.  0.101
   libavdevice    57.  0.101 / 57.  0.101
   libavfilter     6. 31.100 /  6. 31.100
   libavfilter     6. 31.100 /  6. 31.100
   libswscale      4.  0.100 /  4.  0.100
   libswscale      4.  0.100 /  4.  0.100
   libswresample   2.  0.101 /  2.  0.101
   libswresample   2.  0.101 /  2.  0.101
   libpostproc    54.  0.100 / 54.  0.100
   libpostproc    54.  0.100 / 54.  0.100
 Splitting the commandline.
 Reading option '-v' ... matched as option 'v' (set logging level) with
 argument 'debug'.
 Reading option '-user-agent' ... matched as AVOption 'user-agent' with
 argument 'Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Firefox/45.0'.
 Reading option '-headers' ... matched as AVOption 'headers' with argument
 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
 '.
 Reading option '-headers' ... matched as AVOption 'headers' with argument
 'Accept-Language: en-US,en;q=0.8,es-ES;q=0.5,es;q=0.3
 '.
 Reading option '-headers' ... matched as AVOption 'headers' with argument
 'Accept-Encoding: gzip, deflate
 '.
 Reading option '-headers' ... matched as AVOption 'headers' with argument
 'DNT: 1
 '.
 Reading option '-headers' ... matched as AVOption 'headers' with argument
 'Referer: http://www.ponlatv.com/jwplayer6/jwplayer.flash.swf
 '.
 Reading option '-headers' ... matched as AVOption 'headers' with argument
 'Connection: keep-alive
 '.
 Reading option '-i' ... matched as input file with argument
 'http://cdn.sstream.pw/live/cuatro_xrf2a3/playlist.m3u8?st=8If-lp-
 putG5fQ_PAioD-Q&e=1460073969'.
 Reading option '-' ... matched as output file.
 Finished splitting the commandline.
 Parsing a group of options: global .
 Applying option v (set logging level) with argument debug.
 Successfully parsed a group of options.
 Parsing a group of options: input file
 http://cdn.sstream.pw/live/cuatro_xrf2a3/playlist.m3u8?st=8If-lp-
 putG5fQ_PAioD-Q&e=1460073969.
 Successfully parsed a group of options.
 Opening an input file:
 http://cdn.sstream.pw/live/cuatro_xrf2a3/playlist.m3u8?st=8If-lp-
 putG5fQ_PAioD-Q&e=1460073969.
 [http @ 0x1f2c0c0] Setting default whitelist
 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
 [http @ 0x1f2c0c0] request: GET /live/cuatro_xrf2a3/playlist.m3u8?st=8If-
 lp-putG5fQ_PAioD-Q&e=1460073969 HTTP/1.1
 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
 Firefox/45.0
 Accept: */*
 Range: bytes=0-
 Host: cdn.sstream.pw
 Icy-MetaData: 1
 Connection: keep-alive

 and the connection hangs.

 If you remove the last custom header (Connection: keep-alive) you'll see
 the preceeding header taking place, and so on.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/5460>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list