aboutsummaryrefslogtreecommitdiff
path: root/tools/depends
diff options
context:
space:
mode:
authorMemphiz <memphis@machzwo.de>2014-03-24 23:18:25 +0100
committerMemphiz <memphis@machzwo.de>2014-03-24 23:18:25 +0100
commit54126b1fc6c469cb880ac6278e1b27eaf1ae12ad (patch)
treee6c34763e0470a17e4cb4c29c39bc2e49d97fa33 /tools/depends
parentfd16d0b5f011b51aa8fedb6a8beb2d799da82cd9 (diff)
[shairplay] - backport of https://github.com/juhovh/shairplay/commit/ac9240fa569df5a10d534a4cd45740a44ee00f63 - fixes race between ipv4 and ipv6 socket acceptance
Diffstat (limited to 'tools/depends')
-rw-r--r--tools/depends/target/libshairplay/02-fixipv4ipv6race.patch27
-rw-r--r--tools/depends/target/libshairplay/Makefile1
2 files changed, 28 insertions, 0 deletions
diff --git a/tools/depends/target/libshairplay/02-fixipv4ipv6race.patch b/tools/depends/target/libshairplay/02-fixipv4ipv6race.patch
new file mode 100644
index 0000000000..4580d3cf7d
--- /dev/null
+++ b/tools/depends/target/libshairplay/02-fixipv4ipv6race.patch
@@ -0,0 +1,27 @@
+From ac9240fa569df5a10d534a4cd45740a44ee00f63 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Juho=20V=C3=A4h=C3=A4-Herttua?= <juhovh@iki.fi>
+Date: Mon, 24 Mar 2014 20:35:29 +0200
+Subject: [PATCH] Fix #23 on issue tracker.
+
+There is a race condition if IPv4 and IPv6 connections come at the same time.
+---
+ src/lib/httpd.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/lib/httpd.c b/src/lib/httpd.c
+index 1d9e7e2..f081c5e 100644
+--- a/src/lib/httpd.c
++++ b/src/lib/httpd.c
+@@ -237,7 +237,8 @@ struct httpd_s {
+ continue;
+ }
+ }
+- if (httpd->server_fd6 != -1 && FD_ISSET(httpd->server_fd6, &rfds)) {
++ if (httpd->open_connections < httpd->max_connections &&
++ httpd->server_fd6 != -1 && FD_ISSET(httpd->server_fd6, &rfds)) {
+ ret = httpd_accept_connection(httpd, httpd->server_fd6, 1);
+ if (ret == -1) {
+ break;
+--
+1.8.5.5
+
diff --git a/tools/depends/target/libshairplay/Makefile b/tools/depends/target/libshairplay/Makefile
index f86ce82a0b..4221e53701 100644
--- a/tools/depends/target/libshairplay/Makefile
+++ b/tools/depends/target/libshairplay/Makefile
@@ -24,6 +24,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS)
ifeq ($(OS),ios)
cd $(PLATFORM); patch -p1 < ../xcode-llmvfix.patch
endif
+ cd $(PLATFORM); patch -p1 < ../02-fixipv4ipv6race.patch
cd $(PLATFORM); $(AUTORECONF) -vif
cd $(PLATFORM); $(CONFIGURE)