Mercurial > mplayer.hg
comparison libmpdemux/network.c @ 3585:cb985ea11ed5
Added the Host field in the HTTP request.
author | bertrand |
---|---|
date | Tue, 18 Dec 2001 18:45:00 +0000 |
parents | fb9de639ed30 |
children | 2141db140d84 |
comparison
equal
deleted
inserted
replaced
3584:7c4046c04be3 | 3585:cb985ea11ed5 |
---|---|
152 } | 152 } |
153 | 153 |
154 int | 154 int |
155 http_send_request( URL_t *url ) { | 155 http_send_request( URL_t *url ) { |
156 HTTP_header_t *http_hdr; | 156 HTTP_header_t *http_hdr; |
157 char str[80]; | |
157 int fd; | 158 int fd; |
158 http_hdr = http_new_header(); | 159 http_hdr = http_new_header(); |
159 http_set_uri( http_hdr, url->file ); | 160 http_set_uri( http_hdr, url->file ); |
161 snprintf(str, 80, "Host: %s", url->hostname ); | |
162 http_set_field( http_hdr, str); | |
160 http_set_field( http_hdr, "User-Agent: MPlayer"); | 163 http_set_field( http_hdr, "User-Agent: MPlayer"); |
161 http_set_field( http_hdr, "Connection: closed"); | 164 http_set_field( http_hdr, "Connection: closed"); |
162 if( http_build_request( http_hdr )==NULL ) { | 165 if( http_build_request( http_hdr )==NULL ) { |
163 return -1; | 166 return -1; |
164 } | 167 } |