comparison stream/network.c @ 32995:80e4a267f6b8

Allow setting custom http header. Patch by Nikolay Nikolaev, nicknickolaev yahoo com
author cehoyos
date Thu, 17 Mar 2011 08:58:49 +0000
parents 0d95f044c589
children b4c4ee25269f
comparison
equal deleted inserted replaced
32994:eba7d1dc92a6 32995:80e4a267f6b8
55 char *network_password=NULL; 55 char *network_password=NULL;
56 int network_bandwidth=0; 56 int network_bandwidth=0;
57 int network_cookies_enabled = 0; 57 int network_cookies_enabled = 0;
58 char *network_useragent=NULL; 58 char *network_useragent=NULL;
59 char *network_referrer=NULL; 59 char *network_referrer=NULL;
60 char **network_http_header_fields=NULL;
60 61
61 /* IPv6 options */ 62 /* IPv6 options */
62 int network_ipv4_only_proxy = 0; 63 int network_ipv4_only_proxy = 0;
63 64
64 65
244 http_set_field(http_hdr, str); 245 http_set_field(http_hdr, str);
245 } 246 }
246 247
247 if (network_cookies_enabled) cookies_set( http_hdr, server_url->hostname, server_url->url ); 248 if (network_cookies_enabled) cookies_set( http_hdr, server_url->hostname, server_url->url );
248 249
250 if (network_http_header_fields) {
251 int i=0;
252 while (network_http_header_fields[i])
253 http_set_field(http_hdr, network_http_header_fields[i++]);
254 }
255
249 http_set_field( http_hdr, "Connection: close"); 256 http_set_field( http_hdr, "Connection: close");
250 if (proxy) 257 if (proxy)
251 http_add_basic_proxy_authentication(http_hdr, url->username, url->password); 258 http_add_basic_proxy_authentication(http_hdr, url->username, url->password);
252 http_add_basic_authentication(http_hdr, server_url->username, server_url->password); 259 http_add_basic_authentication(http_hdr, server_url->username, server_url->password);
253 if( http_build_request( http_hdr )==NULL ) { 260 if( http_build_request( http_hdr )==NULL ) {