Commit 58f3e09e authored by Jordi Ortiz's avatar Jordi Ortiz Committed by Martin Storsjö

tcp: Set AI_PASSIVE when the socket will be used for listening

Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent c29c1a1b
......@@ -63,6 +63,8 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
snprintf(portstr, sizeof(portstr), "%d", port);
if (listen_socket)
hints.ai_flags |= AI_PASSIVE;
ret = getaddrinfo(hostname, portstr, &hints, &ai);
if (ret) {
av_log(h, AV_LOG_ERROR,
......
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