Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 81389 invoked from network); 17 Mar 2011 20:12:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Mar 2011 20:12:51 -0000 Received: (qmail 52342 invoked by uid 500); 17 Mar 2011 20:12:50 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 52247 invoked by uid 500); 17 Mar 2011 20:12:50 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 52228 invoked by uid 99); 17 Mar 2011 20:12:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Mar 2011 20:12:50 +0000 X-ASF-Spam-Status: No, hits=0.2 required=5.0 tests=ASF_LIST_OPS,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RFC_ABUSE_POST,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of ngoutte@hotmail.com designates 65.55.34.221 as permitted sender) Received: from [65.55.34.221] (HELO col0-omc4-s19.col0.hotmail.com) (65.55.34.221) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 Mar 2011 20:12:41 +0000 Received: from COL117-W41 ([65.55.34.199]) by col0-omc4-s19.col0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 17 Mar 2011 13:12:22 -0700 Message-ID: Content-Type: multipart/alternative; boundary="_b5567e3d-56e6-46c0-897a-f406fab86531_" X-Originating-IP: [88.174.118.119] From: Niko Goutte To: , Subject: RE: cpu 100% or destroy brigade Date: Thu, 17 Mar 2011 21:12:20 +0100 Importance: Normal In-Reply-To: References: MIME-Version: 1.0 X-OriginalArrivalTime: 17 Mar 2011 20:12:22.0185 (UTC) FILETIME=[9FE89190:01CBE4DF] --_b5567e3d-56e6-46c0-897a-f406fab86531_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello=2C I developped an apache module which send small data coming from file. A client request from file through a Get request and data are sent with blo= ck size equals to 100KB. One 100KB buffer is allocated in the pool=2C then each buffer are used to c= reate one bucket that will be sent just after being inserted into the briga= de. To sum up: ---------------------------------------------------------------------------= ------------------------------------------------- apr_bucket_brigade *bb=3B apr_bucket* b=3B bb =3D apr_brigade_create(r->pool=2C r->connection->bucket_alloc)=3B Buf =3D apr_palloc(r->pool=2C100KB)=3B while(lastBufferToSend=3D=3Dfalse) { Processing(Buf)=3B b =3D apr_bucket_pool_create(Buf =2Csize=2C r->pool=2C r->connection->buc= ket_alloc) =3B =20 APR_BRIGADE_INSERT_TAIL(bb=2C b)=3B if(lastBufferToSend) { =20 APR_BRIGADE_INSERT_TAIL(bb=2Capr_bucket_eos_create(bb->bucket_alloc))= =3B } =20 rv =3D ap_pass_brigade(r->output_filters=2C bb)=3B apr_bucket_delete(b)=3B apr_brigade_cleanup(bb)=3B } apr_brigade_destroy(bb)=3B ---------------------------------------------------------------------------= ------------------------------------------------- I want to call ap_pass_brigade for each buffer because I want the module to= send immediatly 100KB. Clients don't have to wait for the complete processing of the file more tha= n 2GB. They receive small blocks until the end. =20 ---------------------------------------------------------------------------= ----------------------------------------------- MY PROBLEM: If I do the delete and destroy (apr_bucket_delete(b) and apr_brigade_destro= y(bb)) I do not lock the main thread to 100% but an error is returned: "The server encountered an internal error or misconfiguration and was unabl= e to complete your request " without any logs in the Apache error_logs file. If someone can provide me answer to this problem=2C I'll be very happy. Thank you. =20 Nicolas. = --_b5567e3d-56e6-46c0-897a-f406fab86531_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello=2C

I developped an apache module which send small data coming = from file.
A client request from file through a Get request and data are= sent with block size equals to 100KB.
One 100KB buffer is allocated in = the pool=2C then each buffer are used to create one bucket that will be sen= t just after being inserted into the brigade.
To sum up:
------------= ---------------------------------------------------------------------------= -------------------------------------
apr_bucket_brigade *bb=3B
apr_b= ucket* b=3B

bb =3D apr_brigade_create(r->=3Bpool=2C r->=3Bconnec= tion->=3Bbucket_alloc)=3B
Buf =3D apr_palloc(r->=3Bpool=2C100KB)=3B<= br>
while(lastBufferToSend=3D=3Dfalse)
{
 =3B Processing(Buf)= =3B

 =3B b =3D apr_bucket_pool_create(Buf =2Csize=2C r->=3Bpoo= l=2C r->=3Bconnection->=3Bbucket_alloc) =3B  =3B =3B =3B&nb= sp=3B
 =3B APR_BRIGADE_INSERT_TAIL(bb=2C b)=3B

 =3B if(l= astBufferToSend)
 =3B { =3B =3B =3B
 =3B =3B=  =3B APR_BRIGADE_INSERT_TAIL(bb=2Capr_bucket_eos_create(bb->=3Bbucket= _alloc))=3B
 =3B }
 =3B
 =3B rv =3D ap_pass_brigade(r= ->=3Boutput_filters=2C bb)=3B

 =3B apr_bucket_delete(b)=3B
=  =3B apr_brigade_cleanup(bb)=3B
}

apr_brigade_destroy(bb)=3B<= br>------------------------------------------------------------------------= ----------------------------------------------------

I want to call ap_pass_brigade for each buffer because I want the module to= send immediatly 100KB.
Clients don't have to wait for the complete processing of the file more tha= n 2GB. They receive small blocks until the end.
 =3B
---------------------------------------------------------------------------= -----------------------------------------------
MY PROBLEM:
If I do the delete and destroy (apr_bucket_delete(b) and apr_brigade_destro= y(bb)) I do not lock the main thread to 100% but an error is returned:
"= The server encountered an internal = error or misconfigura= tion and was unable to complete your request "
without any logs in the Apache error_logs file.

If someone can provide me answer to this problem=2C I'll be very happy.
Thank you.
 =3B
Nicolas.




= --_b5567e3d-56e6-46c0-897a-f406fab86531_--