]> code.ossystems Code Review - openembedded-core.git/commitdiff
apr: Fix packet discards HTTP redirect
authorLi Wang <li.wang@windriver.com>
Wed, 8 Jul 2015 07:53:19 +0000 (15:53 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 16 Jul 2015 14:08:40 +0000 (15:08 +0100)
Disconnect the connection by poll() timeout.
If timeout=0 and apr_wait_for_io_or_timeout()=APR_TIMEUP then
apr_socket_recv() returns EAGAIN.

Signed-off-by: Noriaki Yoshitane <yoshitane.nrs@cnt.ncos.nec.co.jp>
Signed-off-by: Li Wang <li.wang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-support/apr/apr/Fix-packet-discards-HTTP-redirect.patch [new file with mode: 0644]
meta/recipes-support/apr/apr_1.5.2.bb

diff --git a/meta/recipes-support/apr/apr/Fix-packet-discards-HTTP-redirect.patch b/meta/recipes-support/apr/apr/Fix-packet-discards-HTTP-redirect.patch
new file mode 100644 (file)
index 0000000..6805b8b
--- /dev/null
@@ -0,0 +1,32 @@
+Fix packet discards HTTP redirect.
+
+Disconnect the connection by poll() timeout.
+If timeout=0 and apr_wait_for_io_or_timeout()=APR_TIMEUP then
+apr_socket_recv() returns EAGAIN.
+
+Upstream-Status: Pending
+
+Signed-off-by: Noriaki Yoshitane <yoshitane.nrs@cnt.ncos.nec.co.jp>
+Signed-off-by: Li Wang <li.wang@windriver.com>
+---
+ network_io/unix/sendrecv.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/network_io/unix/sendrecv.c b/network_io/unix/sendrecv.c
+index c133a26..e8faf15 100644
+--- a/network_io/unix/sendrecv.c
++++ b/network_io/unix/sendrecv.c
+@@ -85,6 +85,10 @@ apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
+                       && (sock->timeout > 0)) {
+ do_select:
+         arv = apr_wait_for_io_or_timeout(NULL, sock, 1);
++        if ((arv == APR_TIMEUP) && (sock->timeout == 0)) {
++            *len = 0;
++            return EAGAIN;
++        }
+         if (arv != APR_SUCCESS) {
+             *len = 0;
+             return arv;
+-- 
+1.7.9.5
+
index aac6276b149df9fe8716f93e8056ee2d8cb16ac5..c1f7f380ed75fedd25e707e7dfa9276eb5dea8e5 100644 (file)
@@ -15,6 +15,7 @@ SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \
            file://configfix.patch \
            file://run-ptest \
            file://upgrade-and-fix-1.5.1.patch \
+           file://Fix-packet-discards-HTTP-redirect.patch \
 "
 
 SRC_URI[md5sum] = "4e9769f3349fe11fc0a5e1b224c236aa"