From: Joe Orton Date: Tue, 15 Jun 2004 20:27:17 +0000 (+0000) Subject: * modules/echo/mod_echo.c (process_echo_connection): Fix brigade X-Git-Tag: pre_ajp_proxy~149 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7cced87bd7add3a40e91564beac8de6b06c7f627;p=apache * modules/echo/mod_echo.c (process_echo_connection): Fix brigade 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 --- diff --git a/modules/echo/mod_echo.c b/modules/echo/mod_echo.c index f3adbc96f7..111f312122 100644 --- a/modules/echo/mod_echo.c +++ b/modules/echo/mod_echo.c @@ -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; }