Author: rhuijben
Date: Thu Nov 19 17:37:57 2015
New Revision: 1715222

URL: http://svn.apache.org/viewvc?rev=1715222&view=rev
Log:
Improve compatibility of http/2 response handling with the legacy handling
a bit to fix some Subversion usecases.

* protocols/http2_stream.c
  (serf_http2__stream_processor): Keep calling serf__handle_response() until
     we get some not success result.

Modified:
    serf/trunk/protocols/http2_stream.c

Modified: serf/trunk/protocols/http2_stream.c
URL: 
http://svn.apache.org/viewvc/serf/trunk/protocols/http2_stream.c?rev=1715222&r1=1715221&r2=1715222&view=diff
==============================================================================
--- serf/trunk/protocols/http2_stream.c (original)
+++ serf/trunk/protocols/http2_stream.c Thu Nov 19 17:37:57 2015
@@ -697,7 +697,17 @@ serf_http2__stream_processor(void *baton
 
         SERF_H2_assert(request->resp_bkt != NULL);
 
-        status = serf__handle_response(request, request->respool);
+        /* Response handlers are expected to read until they get some error,
+           but at least some implementations assume that just returning
+           APR_SUCCESS will have them called again, as that used to work as
+           an APR_EAGAIN like system in HTTP/1.
+
+           But we can't just fall back with HTTP/2, as we might still have
+           some part of the frame open (good case), or we might have completed
+           the frame and are never called again. */
+        do {
+            status = serf__handle_response(request, request->respool);
+        } while (status == APR_SUCCESS);
 
         if (!APR_STATUS_IS_EOF(status)
             && !SERF_BUCKET_READ_ERROR(status))


Reply via email to