httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Eissing <stefan.eiss...@greenbytes.de>
Subject stop the press!
Date Thu, 08 Oct 2015 10:06:04 GMT
I need a tiny patch for mod_http2 that solves an empty response problem with the latest nghttp2
libraries:

Jim, can we get that still in? Commited in trunk as r1707468.

//Stefan

Index: modules/http2/h2_util.c
===================================================================
--- modules/http2/h2_util.c	(revision 1707467)
+++ modules/http2/h2_util.c	(revision 1707468)
@@ -484,20 +484,39 @@
 
 int h2_util_has_eos(apr_bucket_brigade *bb, apr_size_t len)
 {
-    apr_bucket *b, *end;
+    apr_bucket *b;
     
-    apr_status_t status = last_not_included(bb, len, 0, 0, &end);
-    if (status != APR_SUCCESS) {
-        return status;
+    if (len == 0) {
+        /* special case: this is only true, if there are only meta
+         * and an eos bucket in the brigade head.
+         */
+        for (b = APR_BRIGADE_FIRST(bb);
+             b != APR_BRIGADE_SENTINEL(bb);
+             b = APR_BUCKET_NEXT(b))
+        {
+            if (!APR_BUCKET_IS_METADATA(b) && b->length != 0) {
+                break;
+            }
+            else if (APR_BUCKET_IS_EOS(b)) {
+                return 1;
+            }
+        }
     }
-    
-    for (b = APR_BRIGADE_FIRST(bb);
-         b != APR_BRIGADE_SENTINEL(bb) && b != end;
-         b = APR_BUCKET_NEXT(b))
-    {
-        if (APR_BUCKET_IS_EOS(b)) {
-            return 1;
+    else {
+        apr_bucket *end;
+        apr_status_t status = last_not_included(bb, len, 0, 0, &end);
+        if (status != APR_SUCCESS) {
+            return status;
         }
+        
+        for (b = APR_BRIGADE_FIRST(bb);
+             b != APR_BRIGADE_SENTINEL(bb) && b != end;
+             b = APR_BUCKET_NEXT(b))
+        {
+            if (APR_BUCKET_IS_EOS(b)) {
+                return 1;
+            }
+        }
     }
     return 0;
 }
Index: modules/http2/h2_version.h
===================================================================
--- modules/http2/h2_version.h	(revision 1707467)
+++ modules/http2/h2_version.h	(revision 1707468)
@@ -20,7 +20,7 @@
  * @macro
  * Version number of the h2 module as c string
  */
-#define MOD_HTTP2_VERSION "0.9.9"
+#define MOD_HTTP2_VERSION "1.0.0"
 
 /**
  * @macro
@@ -28,7 +28,7 @@
  * release. This is a 24 bit number with 8 bits for major number, 8 bits
  * for minor and 8 bits for patch. Version 1.2.3 becomes 0x010203.
  */
-#define MOD_HTTP2_VERSION_NUM 0x000909
+#define MOD_HTTP2_VERSION_NUM 0x010000
 
 
 #endif /* mod_h2_h2_version_h */


Mime
View raw message