summaryrefslogtreecommitdiff
path: root/libavformat/tcp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-06-01 19:52:35 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-06-01 19:59:39 +0200
commitfbc5e0fae12a72b547e6d841e80116ce5c26fbf0 (patch)
treed3cec49752d4d014852a2d7afefa02cf1b1f35e5 /libavformat/tcp.c
parent0d83edaba9f4b298fa8a645a032bc84e0c03ef1b (diff)
parentdbaf79c9d7270eafd2479d9c650efa1433d65efd (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: http: Add the url_shutdown function for https, too http: Simplify code by removing a local variable http: Clear the old URLContext pointer when closed tcp: Try enabling SO_REUSEADDR when listening tcp: Check the return values from bind and accept avisynth: Make sure the filename passed to avisynth is in the right code page Conflicts: libavformat/http.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/tcp.c')
-rw-r--r--libavformat/tcp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index a8ebd81dc9..a46957eb47 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -83,6 +83,8 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
if (listen_socket) {
int fd1;
+ int reuse = 1;
+ setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &reuse, sizeof(reuse));
ret = bind(fd, cur_ai->ai_addr, cur_ai->ai_addrlen);
if (ret) {
ret = ff_neterrno();