Module: libav Branch: master Commit: 58f3e09ee4cd7fe4b757797f0828fc3549c58535
Author: Jordi Ortiz <[email protected]> Committer: Martin Storsjö <[email protected]> Date: Tue Jun 26 19:21:11 2012 +0200 tcp: Set AI_PASSIVE when the socket will be used for listening Signed-off-by: Martin Storsjö <[email protected]> --- libavformat/tcp.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/libavformat/tcp.c b/libavformat/tcp.c index badc0ba..5313195 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, _______________________________________________ libav-commits mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-commits
