Browse Source

http: Add the trailing endlines if they are missing

Makes slightly easier the life of those want to use the option
from the command line
tags/n2.8
Luca Barbato 10 years ago
parent
commit
5ae178539b
1 changed files with 8 additions and 1 deletions
  1. +8
    -1
      libavformat/http.c

+ 8
- 1
libavformat/http.c View File

@@ -287,9 +287,16 @@ static int http_open(URLContext *h, const char *uri, int flags,

if (s->headers) {
int len = strlen(s->headers);
if (len < 2 || strcmp("\r\n", s->headers + len - 2))
if (len < 2 || strcmp("\r\n", s->headers + len - 2)) {
av_log(h, AV_LOG_WARNING,
"No trailing CRLF found in HTTP header.\n");
ret = av_reallocp(&s->headers, len + 3);
if (ret < 0)
return ret;
s->headers[len] = '\r';
s->headers[len + 1] = '\n';
s->headers[len + 2] = '\0';
}
}

ret = http_open_cnx(h, options);


Loading…
Cancel
Save