Originally committed as revision 24266 to svn://svn.ffmpeg.org/ffmpeg/trunk
Martin Storsjö authored on 2010/07/16 23:15:37... | ... |
@@ -210,7 +210,7 @@ static int process_line(URLContext *h, char *line, int line_count, |
210 | 210 |
int *new_location) |
211 | 211 |
{ |
212 | 212 |
HTTPContext *s = h->priv_data; |
213 |
- char *tag, *p; |
|
213 |
+ char *tag, *p, *end; |
|
214 | 214 |
|
215 | 215 |
/* end of header */ |
216 | 216 |
if (line[0] == '\0') |
... | ... |
@@ -222,14 +222,18 @@ static int process_line(URLContext *h, char *line, int line_count, |
222 | 222 |
p++; |
223 | 223 |
while (isspace(*p)) |
224 | 224 |
p++; |
225 |
- s->http_code = strtol(p, NULL, 10); |
|
225 |
+ s->http_code = strtol(p, &end, 10); |
|
226 | 226 |
|
227 | 227 |
dprintf(NULL, "http_code=%d\n", s->http_code); |
228 | 228 |
|
229 | 229 |
/* error codes are 4xx and 5xx, but regard 401 as a success, so we |
230 | 230 |
* don't abort until all headers have been parsed. */ |
231 |
- if (s->http_code >= 400 && s->http_code < 600 && s->http_code != 401) |
|
231 |
+ if (s->http_code >= 400 && s->http_code < 600 && s->http_code != 401) { |
|
232 |
+ end += strspn(end, SPACE_CHARS); |
|
233 |
+ av_log(NULL, AV_LOG_WARNING, "HTTP error %d %s\n", |
|
234 |
+ s->http_code, end); |
|
232 | 235 |
return -1; |
236 |
+ } |
|
233 | 237 |
} else { |
234 | 238 |
while (*p != '\0' && *p != ':') |
235 | 239 |
p++; |