tcp: Check url_interrupt_cb if connect was interrupted by a signal
This makes it possible to abort a blocking connect call. Patch by Thomas Guillem, thomas dot guillem at gmail Originally committed as revision 26014 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
06f6f78578
commit
1aa58c6405
@ -73,8 +73,11 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
|
|||||||
redo:
|
redo:
|
||||||
ret = connect(fd, cur_ai->ai_addr, cur_ai->ai_addrlen);
|
ret = connect(fd, cur_ai->ai_addr, cur_ai->ai_addrlen);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
if (ff_neterrno() == FF_NETERROR(EINTR))
|
if (ff_neterrno() == FF_NETERROR(EINTR)) {
|
||||||
|
if (url_interrupt_cb())
|
||||||
|
goto fail1;
|
||||||
goto redo;
|
goto redo;
|
||||||
|
}
|
||||||
if (ff_neterrno() != FF_NETERROR(EINPROGRESS) &&
|
if (ff_neterrno() != FF_NETERROR(EINPROGRESS) &&
|
||||||
ff_neterrno() != FF_NETERROR(EAGAIN))
|
ff_neterrno() != FF_NETERROR(EAGAIN))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
Loading…
Reference in New Issue
Block a user