]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
* modules/ssl/ssl_engine_io.c (ssl_io_input_read): Fix rollback
authorJoe Orton <jorton@apache.org>
Tue, 17 Aug 2004 16:31:23 +0000 (16:31 +0000)
committerJoe Orton <jorton@apache.org>
Tue, 17 Aug 2004 16:31:23 +0000 (16:31 +0000)
handling for AP_MODE_SPECULATIVE.

PR: 30134

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk/modules/ssl@104687 13f79535-47bb-0310-9956-ffa450edef68

ssl_engine_io.c

index 29e9a650f8c53d4fe8ee1bdd6b9f91324a1584e5..671fa5a5476904e18b0517ff9ad12d9a6937dcd0 100644 (file)
@@ -564,8 +564,12 @@ static apr_status_t ssl_io_input_read(bio_filter_in_ctx_t *inctx,
         *len = bytes;
         if (inctx->mode == AP_MODE_SPECULATIVE) {
             /* We want to rollback this read. */
-            inctx->cbuf.value -= bytes;
-            inctx->cbuf.length += bytes;
+            if (inctx->cbuf.length > 0) {
+                inctx->cbuf.value -= bytes;
+                inctx->cbuf.length += bytes;
+            } else {
+                char_buffer_write(&inctx->cbuf, buf, (int)bytes);
+            }
             return APR_SUCCESS;
         }
         /* This could probably be *len == wanted, but be safe from stray