Skip to content

Commit

Permalink
Merge commit '5ae178539b91d25710b7bb322d156c31aea9f8bf'
Browse files Browse the repository at this point in the history
* commit '5ae178539b91d25710b7bb322d156c31aea9f8bf':
  http: Add the trailing endlines if they are missing

Merged-by: Michael Niedermayer <michael@niedermayer.cc>
  • Loading branch information
michaelni committed Jul 30, 2015
2 parents 77d8fd5 + 5ae1785 commit 8e67599
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libavformat/http.c
Expand Up @@ -368,9 +368,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';
}
}

if (s->listen) {
Expand Down

0 comments on commit 8e67599

Please sign in to comment.