Mercurial > libavformat.hg
comparison http.c @ 6150:6b770ef6cbea libavformat
Use url_write(), not http_write(), for sending the HTTP headers. This prevents
them from being sent using chunked encoding (I don't think this ever happened,
but either way it would be wrong).
| author | rbultje |
|---|---|
| date | Sun, 20 Jun 2010 21:38:16 +0000 |
| parents | f221641c262a |
| children | 8634f4b534fc |
comparison
equal
deleted
inserted
replaced
| 6149:902c290b60ed | 6150:6b770ef6cbea |
|---|---|
| 51 int is_chunked; | 51 int is_chunked; |
| 52 } HTTPContext; | 52 } HTTPContext; |
| 53 | 53 |
| 54 static int http_connect(URLContext *h, const char *path, const char *hoststr, | 54 static int http_connect(URLContext *h, const char *path, const char *hoststr, |
| 55 const char *auth, int *new_location); | 55 const char *auth, int *new_location); |
| 56 static int http_write(URLContext *h, const uint8_t *buf, int size); | |
| 57 | 56 |
| 58 void ff_http_set_headers(URLContext *h, const char *headers) | 57 void ff_http_set_headers(URLContext *h, const char *headers) |
| 59 { | 58 { |
| 60 HTTPContext *s = h->priv_data; | 59 HTTPContext *s = h->priv_data; |
| 61 int len = strlen(headers); | 60 int len = strlen(headers); |
| 321 post && s->is_chunked ? "Transfer-Encoding: chunked\r\n" : "", | 320 post && s->is_chunked ? "Transfer-Encoding: chunked\r\n" : "", |
| 322 headers, | 321 headers, |
| 323 authstr ? authstr : ""); | 322 authstr ? authstr : ""); |
| 324 | 323 |
| 325 av_freep(&authstr); | 324 av_freep(&authstr); |
| 326 if (http_write(h, s->buffer, strlen(s->buffer)) < 0) | 325 if (url_write(s->hd, s->buffer, strlen(s->buffer)) < 0) |
| 327 return AVERROR(EIO); | 326 return AVERROR(EIO); |
| 328 | 327 |
| 329 /* init input buffer */ | 328 /* init input buffer */ |
| 330 s->buf_ptr = s->buffer; | 329 s->buf_ptr = s->buffer; |
| 331 s->buf_end = s->buffer; | 330 s->buf_end = s->buffer; |
