[FFmpeg-devel] Fix for closed connection with http_persistent
Moritz Barsnick
barsnick at gmx.net
Sat Jul 27 21:32:52 EEST 2019
> + // read headers if not already loaded (this is needed to check if connection is closing)
> + if (!s->end_header) {
> + int new_location;
> + http_read_header(h, &new_location);
> +
> + if (s->willclose) {
> + ret = ffurl_closep(&s->hd);
> +
> + if (ret < 0)
> + return ret;
> + }
> + }
> +
Your indentation style doesn't correspond to ffmpeg's.
> @@ -1637,6 +1647,7 @@ static int http_shutdown(URLContext *h, int flags)
> s->hd->flags |= AVIO_FLAG_NONBLOCK;
> read_ret = ffurl_read(s->hd, buf, sizeof(buf));
> s->hd->flags &= ~AVIO_FLAG_NONBLOCK;
> +
> if (read_ret < 0 && read_ret != AVERROR(EAGAIN)) {
> av_log(h, AV_LOG_ERROR, "URL read error: %s\n", av_err2str(read_ret));
> ret = read_ret;
This change doesn't belong here.
Furthermore, the explanation from your original e-mail can go into the
commit message. Incl. the additional remark "Fixes #7975". The first
line of the commit message needs to be prefixed with "avformat/http: ".
Moritz
More information about the ffmpeg-devel
mailing list