Mercurial > libavformat.hg
comparison http.c @ 6390:27242bd0812c libavformat
Move the definition of the maximum url size for static buffers to internal.h
| author | mstorsjo |
|---|---|
| date | Thu, 19 Aug 2010 14:50:40 +0000 |
| parents | 3472338a5e13 |
| children | fed4be333771 |
comparison
equal
deleted
inserted
replaced
| 6389:054de75e4a49 | 6390:27242bd0812c |
|---|---|
| 33 /* XXX: POST protocol is not completely implemented because ffmpeg uses | 33 /* XXX: POST protocol is not completely implemented because ffmpeg uses |
| 34 only a subset of it. */ | 34 only a subset of it. */ |
| 35 | 35 |
| 36 /* used for protocol handling */ | 36 /* used for protocol handling */ |
| 37 #define BUFFER_SIZE 1024 | 37 #define BUFFER_SIZE 1024 |
| 38 #define URL_SIZE 4096 | |
| 39 #define MAX_REDIRECTS 8 | 38 #define MAX_REDIRECTS 8 |
| 40 | 39 |
| 41 typedef struct { | 40 typedef struct { |
| 42 const AVClass *class; | 41 const AVClass *class; |
| 43 URLContext *hd; | 42 URLContext *hd; |
| 44 unsigned char buffer[BUFFER_SIZE], *buf_ptr, *buf_end; | 43 unsigned char buffer[BUFFER_SIZE], *buf_ptr, *buf_end; |
| 45 int line_count; | 44 int line_count; |
| 46 int http_code; | 45 int http_code; |
| 47 int64_t chunksize; /**< Used if "Transfer-Encoding: chunked" otherwise -1. */ | 46 int64_t chunksize; /**< Used if "Transfer-Encoding: chunked" otherwise -1. */ |
| 48 int64_t off, filesize; | 47 int64_t off, filesize; |
| 49 char location[URL_SIZE]; | 48 char location[MAX_URL_SIZE]; |
| 50 HTTPAuthState auth_state; | 49 HTTPAuthState auth_state; |
| 51 unsigned char headers[BUFFER_SIZE]; | 50 unsigned char headers[BUFFER_SIZE]; |
| 52 int willclose; /**< Set if the server correctly handles Connection: close and will close the connection after feeding us the content. */ | 51 int willclose; /**< Set if the server correctly handles Connection: close and will close the connection after feeding us the content. */ |
| 53 } HTTPContext; | 52 } HTTPContext; |
| 54 | 53 |
| 160 HTTPContext *s = h->priv_data; | 159 HTTPContext *s = h->priv_data; |
| 161 | 160 |
| 162 h->is_streamed = 1; | 161 h->is_streamed = 1; |
| 163 | 162 |
| 164 s->filesize = -1; | 163 s->filesize = -1; |
| 165 av_strlcpy(s->location, uri, URL_SIZE); | 164 av_strlcpy(s->location, uri, sizeof(s->location)); |
| 166 | 165 |
| 167 return http_open_cnx(h); | 166 return http_open_cnx(h); |
| 168 } | 167 } |
| 169 static int http_getc(HTTPContext *s) | 168 static int http_getc(HTTPContext *s) |
| 170 { | 169 { |
