Browse Source

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

Signed-off-by: Martin Storsjö <martin@martin.st>
tags/n1.0
Jordi Ortiz Martin Storsjö 13 years ago
parent
commit
58f3e09ee4
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavformat/tcp.c

+ 2
- 0
libavformat/tcp.c View File

@@ -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,


Loading…
Cancel
Save