From 58f3e09ee4cd7fe4b757797f0828fc3549c58535 Mon Sep 17 00:00:00 2001 From: Jordi Ortiz Date: Tue, 26 Jun 2012 19:21:11 +0200 Subject: tcp: Set AI_PASSIVE when the socket will be used for listening MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Martin Storsjö --- libavformat/tcp.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'libavformat/tcp.c') diff --git a/libavformat/tcp.c b/libavformat/tcp.c index badc0ba935..5313195e5c 100644 --- a/libavformat/tcp.c +++ b/libavformat/tcp.c @@ -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, -- cgit v1.2.3