[FFmpeg-cvslog] tcp: Set AI_PASSIVE when the socket will be used for listening
Jordi Ortiz
git at videolan.org
Thu Jun 28 01:09:05 CEST 2012
ffmpeg | branch: master | Jordi Ortiz <nenjordi at gmail.com> | Tue Jun 26 19:21:11 2012 +0200| [58f3e09ee4cd7fe4b757797f0828fc3549c58535] | committer: Martin Storsjö
tcp: Set AI_PASSIVE when the socket will be used for listening
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=58f3e09ee4cd7fe4b757797f0828fc3549c58535
---
libavformat/tcp.c | 2 ++
1 file changed, 2 insertions(+)
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,
More information about the ffmpeg-cvslog
mailing list