Commit 20150f3d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

network: fix fallback w/o TCP Fast Open

parent ea077d92
......@@ -509,25 +509,31 @@ static ssize_t vlc_tls_ConnectWrite(vlc_tls_t *tls,
};
ssize_t ret;
/* Next time, write directly. Do not retry to connect. */
tls->writev = vlc_tls_SocketWrite;
ret = sendmsg(vlc_tls_SocketGetFD(tls), &msg, MSG_NOSIGNAL|MSG_FASTOPEN);
if (ret >= 0)
{ /* Fast open in progress */
tls->writev = vlc_tls_SocketWrite;
return ret;
}
if (errno == EINPROGRESS)
return vlc_tls_WaitConnect(tls);
{
if (vlc_tls_WaitConnect(tls))
return -1;
}
else
if (errno != EOPNOTSUPP)
return -1;
/* Fast open not supported or disabled... fallback to normal mode */
#else
tls->writev = vlc_tls_SocketWrite;
#endif
if (vlc_tls_Connect(tls))
return -1;
/* Next time, write directly. Do not retry to connect. */
tls->writev = vlc_tls_SocketWrite;
return vlc_tls_SocketWrite(tls, iov, count);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment