Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 08014D68C for ; Mon, 27 Aug 2012 13:58:28 +0000 (UTC) Received: (qmail 29209 invoked by uid 500); 27 Aug 2012 13:58:27 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 29142 invoked by uid 500); 27 Aug 2012 13:58:27 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 29129 invoked by uid 99); 27 Aug 2012 13:58:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Aug 2012 13:58:27 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Aug 2012 13:58:26 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8955823888FE; Mon, 27 Aug 2012 13:57:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1377685 - /httpd/httpd/trunk/modules/lua/mod_lua.c Date: Mon, 27 Aug 2012 13:57:43 -0000 To: cvs@httpd.apache.org From: humbedooh@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120827135743.8955823888FE@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: humbedooh Date: Mon Aug 27 13:57:43 2012 New Revision: 1377685 URL: http://svn.apache.org/viewvc?rev=1377685&view=rev Log: Trying to tie up some loose ends: - Return immediately if the return val of ap_pass_brigade != APR_SUCCESS - Return a bit earlier when dealing with input filters, so as to not build up a huge backlog. Modified: httpd/httpd/trunk/modules/lua/mod_lua.c Modified: httpd/httpd/trunk/modules/lua/mod_lua.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/mod_lua.c?rev=1377685&r1=1377684&r2=1377685&view=diff ============================================================================== --- httpd/httpd/trunk/modules/lua/mod_lua.c (original) +++ httpd/httpd/trunk/modules/lua/mod_lua.c Mon Aug 27 13:57:43 2012 @@ -390,6 +390,7 @@ static apr_status_t lua_output_filter_ha lua_filter_ctx* ctx; conn_rec *c = r->connection; apr_bucket *pbktIn; + apr_status_t rv; /* Set up the initial filter context and acquire the function. * The corresponding Lua function should yield here. @@ -433,8 +434,11 @@ static apr_status_t lua_output_filter_ha pbktOut = apr_bucket_heap_create(output, olen, NULL, c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(ctx->tmpBucket, pbktOut); - ap_pass_brigade(f->next, ctx->tmpBucket); + rv = ap_pass_brigade(f->next, ctx->tmpBucket); apr_brigade_cleanup(ctx->tmpBucket); + if (rv != APR_SUCCESS) { + return rv; + } } else { ctx->broken = 1; @@ -462,7 +466,11 @@ static apr_status_t lua_output_filter_ha pbktEOS = apr_bucket_eos_create(c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(ctx->tmpBucket, pbktEOS); ap_lua_release_state(L, ctx->spec, r); - ap_pass_brigade(f->next, ctx->tmpBucket); + rv = ap_pass_brigade(f->next, ctx->tmpBucket); + apr_brigade_cleanup(ctx->tmpBucket); + if (rv != APR_SUCCESS) { + return rv; + } } } /* Clean up */ @@ -549,6 +557,7 @@ static apr_status_t lua_input_filter_han pbktOut = apr_bucket_heap_create(output, olen, 0, c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(pbbOut, pbktOut); apr_bucket_delete(pbktIn); + return APR_SUCCESS; } else { ctx->broken = 1;