From c99d8fc8981d13203c2bbf9c12b7720cd8632ae1 Mon Sep 17 00:00:00 2001 From: cehoyos Date: Thu, 17 Mar 2011 08:58:49 +0000 Subject: stream: http: Allow setting custom http header Patch by Nikolay Nikolaev, nicknickolaev yahoo com git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@33082 b3059339-0415-0410-9bf9-f77b7e298cf2 --- stream/network.c | 7 +++++++ stream/network.h | 2 ++ 2 files changed, 9 insertions(+) (limited to 'stream') diff --git a/stream/network.c b/stream/network.c index c6776ac29a..b722023061 100644 --- a/stream/network.c +++ b/stream/network.c @@ -58,6 +58,7 @@ int network_bandwidth=0; int network_cookies_enabled = 0; char *network_useragent=NULL; char *network_referrer=NULL; +char **network_http_header_fields=NULL; /* IPv6 options */ int network_ipv4_only_proxy = 0; @@ -250,6 +251,12 @@ http_send_request( URL_t *url, off_t pos ) { if (network_cookies_enabled) cookies_set( http_hdr, server_url->hostname, server_url->url ); + if (network_http_header_fields) { + int i=0; + while (network_http_header_fields[i]) + http_set_field(http_hdr, network_http_header_fields[i++]); + } + http_set_field( http_hdr, "Connection: close"); if (proxy) http_add_basic_proxy_authentication(http_hdr, url->username, url->password); diff --git a/stream/network.h b/stream/network.h index 1c395acc49..33b668c516 100644 --- a/stream/network.h +++ b/stream/network.h @@ -61,6 +61,8 @@ typedef struct { extern const mime_struct_t mime_type_table[]; +extern char **network_http_header_fields; + streaming_ctrl_t *streaming_ctrl_new(void); int streaming_bufferize( streaming_ctrl_t *streaming_ctrl, char *buffer, int size); -- cgit v1.2.3