Re: Segfaults in ConnectionHander (Possible Solution)
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Apache Server configuration support > Apache Mod-Python > Re: Segfaults in ConnectionHander (Possible Solution)




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: Segfaults in ConnectionHander (Possible Solution)  
Volodya


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-31-06 12:47 PM

On Mon, Jan 30, 2006 at 09:40:39PM -0500, Graham Dumpleton wrote:
> Graham Dumpleton wrote .. 
>
> Okay, this may work, but the EAGAIN propogating backup as an empty
> string to Python can cause a tight loop to occur where calls are going
> out and back into Python code. This will occur until something is read
> or an error occurs.
>
> To avoid the back and forth, another option may be:
>
>     while (APR_BRIGADE_EMPTY(bb)) {
>         Py_BEGIN_ALLOW_THREADS;
>         rc = ap_get_brigade(c->input_filters, bb, mode, APR_BLOCK_READ, bu
fsize);
>         Py_END_ALLOW_THREADS;
>
>         if (! APR_STATUS_IS_SUCCESS(rc)) {
>             PyErr_SetObject(PyExc_IOError,
>                             PyString_FromString("Connection read error"));
>             return NULL;
>         }
>     }
>

Graham,

this code runs smoothly, i.e. no segfaults, all tests passed:
FreeBSD 4.9:

Apache/2.0.50 (prefork) Python/2.3.4
Apache/2.0.55 (prefork) Python/2.4.2

Thanks!







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:20 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register