You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ic...@apache.org on 2015/10/08 13:24:11 UTC

svn commit: r1707497 - in /httpd/httpd/trunk/modules/http2: h2_util.c h2_version.h

Author: icing
Date: Thu Oct  8 11:24:11 2015
New Revision: 1707497

URL: http://svn.apache.org/viewvc?rev=1707497&view=rev
Log:
improved fix for EOS checking on zero length read, bump to 1.0.0

Modified:
    httpd/httpd/trunk/modules/http2/h2_util.c
    httpd/httpd/trunk/modules/http2/h2_version.h

Modified: httpd/httpd/trunk/modules/http2/h2_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_util.c?rev=1707497&r1=1707496&r2=1707497&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_util.c (original)
+++ httpd/httpd/trunk/modules/http2/h2_util.c Thu Oct  8 11:24:11 2015
@@ -539,14 +539,36 @@ apr_status_t h2_util_bb_avail(apr_bucket
                               apr_size_t *plen, int *peos)
 {
     apr_status_t status;
-    /* test read to determine available length */
     apr_off_t blen = 0;
-    status = apr_brigade_length(bb, 0, &blen);
-    if (blen < (apr_off_t)*plen) {
-        *plen = blen;
+
+    /* test read to determine available length */
+    status = apr_brigade_length(bb, 1, &blen);
+    if (status != APR_SUCCESS) {
+        return status;
+    }
+    else if (blen == 0) {
+        /* empty brigade, does it have an EOS bucket somwhere? */
+        *plen = 0;
+        *peos = h2_util_has_eos(bb, 0);
+    }
+    else if (blen > 0) {
+        /* data in the brigade, limit the length returned. Check for EOS
+         * bucket only if we indicate data. This is required since plen == 0
+         * means "the whole brigade" for h2_util_hash_eos()
+         */
+        if (blen < (apr_off_t)*plen) {
+            *plen = blen;
+        }
+        *peos = (*plen > 0)? h2_util_has_eos(bb, *plen) : 0;
+    }
+    else if (blen < 0) {
+        /* famous SHOULD NOT HAPPEN, sinc we told apr_brigade_length to readall
+         */
+        *plen = 0;
+        *peos = h2_util_has_eos(bb, 0);
+        return APR_EINVAL;
     }
-    *peos = h2_util_has_eos(bb, *plen);
-    return status;
+    return APR_SUCCESS;
 }
 
 apr_status_t h2_util_bb_readx(apr_bucket_brigade *bb, 

Modified: httpd/httpd/trunk/modules/http2/h2_version.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http2/h2_version.h?rev=1707497&r1=1707496&r2=1707497&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http2/h2_version.h (original)
+++ httpd/httpd/trunk/modules/http2/h2_version.h Thu Oct  8 11:24:11 2015
@@ -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 */