[FFmpeg-devel] [PATCH] ff_connect_parallel: do not fail when getsockopt(SO_ERROR) returns EISCONN

Peter Ross pross at xvid.org
Thu Nov 29 10:29:20 EET 2018


for O_NONBLOCK connect(), the watt32 socket library returns EISCONN when connection is established
---

watt32 is a DOS/Windows BSD socket library.

it seems iOS suffers this EISCON problem too, but i am unsure why it hasn't been reported here before.
i don't have iOS device to test.
https://github.com/warmcat/libwebsockets/issues/17


 libavformat/network.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/network.c b/libavformat/network.c
index 5664455d18..783de34a98 100644
--- a/libavformat/network.c
+++ b/libavformat/network.c
@@ -475,7 +475,7 @@ int ff_connect_parallel(struct addrinfo *addrs, int timeout_ms_per_address,
                     last_err = ff_neterrno();
                 else if (last_err != 0)
                     last_err = AVERROR(last_err);
-                if (last_err == 0) {
+                if (last_err == 0 || last_err == AVERROR(EISCONN)) {
                     // Everything is ok, we seem to have a successful
                     // connection. Close other sockets and return this one.
                     for (j = 0; j < nb_attempts; j++)
-- 
2.17.1

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20181129/1987f917/attachment.sig>


More information about the ffmpeg-devel mailing list