diff options
author | Joe Orton <jorton@apache.org> | 2004-06-15 22:27:17 +0200 |
---|---|---|
committer | Joe Orton <jorton@apache.org> | 2004-06-15 22:27:17 +0200 |
commit | 7cced87bd7add3a40e91564beac8de6b06c7f627 (patch) | |
tree | ae34371dd6a85998a89f955a2f65bc9bd1477a21 /modules | |
parent | sync (diff) | |
download | apache2-7cced87bd7add3a40e91564beac8de6b06c7f627.tar.xz apache2-7cced87bd7add3a40e91564beac8de6b06c7f627.zip |
* 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
Diffstat (limited to 'modules')
-rw-r--r-- | modules/echo/mod_echo.c | 13 |
1 files changed, 8 insertions, 5 deletions
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; } |