httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r628644 - in /httpd/httpd/trunk: CHANGES modules/http/http_filters.c
Date Mon, 18 Feb 2008 08:35:47 GMT
Author: niq
Date: Mon Feb 18 00:35:44 2008
New Revision: 628644

URL: http://svn.apache.org/viewvc?rev=628644&view=rev
Log:
http_filters: Don't send 100-continue when 4xx is due
PR 43711
Reported & tested by Ragini Bisraya
Patch by Chetan Reddy
Reviewed: niq

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/http/http_filters.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=628644&r1=628643&r2=628644&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Mon Feb 18 00:35:44 2008
@@ -2,6 +2,9 @@
 Changes with Apache 2.3.0
 [ When backported to 2.2.x, remove entry from this file ]
 
+  *) http_filters: Don't returm 100-continue on client error
+     PR 43711 [Chetan Reddy <chetanreddy gmail.com>]
+
   *) mod_substitute: The default is now flattening the buckets after
      each substitution. This was mostly done to abide by the
      Principle Of Least Astonishment. The newly added 'q' flag allows for

Modified: httpd/httpd/trunk/modules/http/http_filters.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_filters.c?rev=628644&r1=628643&r2=628644&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_filters.c (original)
+++ httpd/httpd/trunk/modules/http/http_filters.c Mon Feb 18 00:35:44 2008
@@ -325,18 +325,23 @@
             (ctx->state == BODY_LENGTH && ctx->remaining > 0)) &&
             f->r->expecting_100 && f->r->proto_num >= HTTP_VERSION(1,1)
&&
             !(f->r->eos_sent || f->r->bytes_sent)) {
-            char *tmp;
+            if (ap_is_HTTP_CLIENT_ERROR(f->r->status)) {
+                ctx->state = BODY_NONE;
+                ctx->eos_sent = 1;
+            } else {
+                char *tmp;
 
-            tmp = apr_pstrcat(f->r->pool, AP_SERVER_PROTOCOL, " ",
-                              ap_get_status_line(100), CRLF CRLF, NULL);
-            apr_brigade_cleanup(bb);
-            e = apr_bucket_pool_create(tmp, strlen(tmp), f->r->pool,
-                                       f->c->bucket_alloc);
-            APR_BRIGADE_INSERT_HEAD(bb, e);
-            e = apr_bucket_flush_create(f->c->bucket_alloc);
-            APR_BRIGADE_INSERT_TAIL(bb, e);
+                tmp = apr_pstrcat(f->r->pool, AP_SERVER_PROTOCOL, " ",
+                                  ap_get_status_line(100), CRLF CRLF, NULL);
+                apr_brigade_cleanup(bb);
+                e = apr_bucket_pool_create(tmp, strlen(tmp), f->r->pool,
+                                           f->c->bucket_alloc);
+                APR_BRIGADE_INSERT_HEAD(bb, e);
+                e = apr_bucket_flush_create(f->c->bucket_alloc);
+                APR_BRIGADE_INSERT_TAIL(bb, e);
 
-            ap_pass_brigade(f->c->output_filters, bb);
+                ap_pass_brigade(f->c->output_filters, bb);
+            }
         }
 
         /* We can't read the chunk until after sending 100 if required. */



Mime
View raw message