Message ID | 20170410161046.3424-2-klaxa1337@googlemail.com |
---|---|
State | Superseded |
Headers | show |
Le primidi 21 germinal, an CCXXV, Stephan Holljes a écrit : > --- > libavformat/tcp.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) Both patches LGTL. But I do not maintain these files. Regards,
In fact the http patch introduces a bug where it closes the URLContext regardless of ret. New patches shortly. (Also rebased on Simon's patches fixing tcp return codes.) Regards On Tue, Apr 11, 2017 at 11:35 AM, Nicolas George <george@nsup.org> wrote: > Le primidi 21 germinal, an CCXXV, Stephan Holljes a écrit : >> --- >> libavformat/tcp.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) > > Both patches LGTL. But I do not maintain these files. > > Regards, > > -- > Nicolas George
Le duodi 22 germinal, an CCXXV, Stephan Holljes a écrit : > In fact the http patch introduces a bug where it closes the URLContext > regardless of ret. New patches shortly. (Also rebased on Simon's > patches fixing tcp return codes.) You are right, I missed that too. I suggest to add "return 0;" before "fail:", so that it is really only for failure. Regards,
On Tue, Apr 11, 2017 at 7:24 PM, Nicolas George <george@nsup.org> wrote: > Le duodi 22 germinal, an CCXXV, Stephan Holljes a écrit : >> In fact the http patch introduces a bug where it closes the URLContext >> regardless of ret. New patches shortly. (Also rebased on Simon's >> patches fixing tcp return codes.) > > You are right, I missed that too. > > I suggest to add "return 0;" before "fail:", so that it is really only > for failure. > > Regards, > > -- > Nicolas George > _______________________________________________ > ffmpeg-devel mailing list > ffmpeg-devel@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel I like adding return 0 before fail, it saves a comparison. New patches shortly. Regards
diff --git a/libavformat/tcp.c b/libavformat/tcp.c index 3055e48..85e500d 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -203,8 +203,10 @@ static int tcp_accept(URLContext *s, URLContext **c) return ret; cc = (*c)->priv_data; ret = ff_accept(sc->fd, sc->listen_timeout, s); - if (ret < 0) + if (ret < 0) { + ffurl_close(*c); return ff_neterrno(); + } cc->fd = ret; return 0; }