]> granicus.if.org Git - apache/commitdiff
* modules/echo/mod_echo.c (process_echo_connection): Fix brigade
authorJoe Orton <jorton@apache.org>
Tue, 15 Jun 2004 20:27:17 +0000 (20:27 +0000)
committerJoe Orton <jorton@apache.org>
Tue, 15 Jun 2004 20:27:17 +0000 (20:27 +0000)
handling: don't re-use a passed brigade.

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

modules/echo/mod_echo.c

index f3adbc96f77eafb86b12afd605b6f89d7040b1c7..111f3121222d0fc7ead0f48cd1f40419253fd953 100644 (file)
@@ -57,10 +57,10 @@ static int process_echo_connection(conn_rec *c)
     if (!pConfig->bEnabled) {
         return DECLINED;
     }
-    
-    bb = apr_brigade_create(c->pool, c->bucket_alloc);
 
-    for ( ; ; ) {
+    do {
+        bb = apr_brigade_create(c->pool, c->bucket_alloc);
+
         /* Get a single line of input from the client */
         if ((rv = ap_get_brigade(c->input_filters, bb, AP_MODE_GETLINE,
                                  APR_BLOCK_READ, 0) != APR_SUCCESS || 
@@ -72,8 +72,11 @@ static int process_echo_connection(conn_rec *c)
         /* Make sure the data is flushed to the client */
         b = apr_bucket_flush_create(c->bucket_alloc);
         APR_BRIGADE_INSERT_TAIL(bb, b);
-        ap_pass_brigade(c->output_filters, bb);    
-    }
+
+        /* Send back the data. */
+        rv = ap_pass_brigade(c->output_filters, bb);
+    } while (rv == APR_SUCCESS);
+
     return OK;
 }