process initialisation in prefork-MPM

2008-12-22 Thread Andrej van der Zee
Hi, I need to initialise some structures for each process (in prefork MPM) when it is created, and need to be able to access these structures in ap_hook_post_read_request and ap_hook_log_transaction handlers. I would like to initialise the structures before the first HTTP request is being served b

Re: process initialisation in prefork-MPM

2008-12-22 Thread Sorin Manolache
On 2008-12-22, Andrej van der Zee wrote: > Hi, > > I need to initialise some structures for each process (in prefork MPM) > when it is created, and need to be able to access these structures in > ap_hook_post_read_request and ap_hook_log_transaction handlers. I > would like to initialise the s

Re: process initialisation in prefork-MPM

2008-12-22 Thread Andrej van der Zee
> > You hook child_init (ap_hook_child_init) and store your data in global > variables that are accessed by post_read_request and log_transaction. > Easy enough. Thanks, Andrej

Re: process initialisation in prefork-MPM

2008-12-22 Thread Andrej van der Zee
Hi, > > You hook child_init (ap_hook_child_init) and store your data in global > variables that are accessed by post_read_request and log_transaction. > BTW, in a worker-MPM, is child_init executed for every created worker-thread? Or is it per process? Thank you, Andrej

Re: process initialisation in prefork-MPM

2008-12-22 Thread Saju Pillai
On 22-Dec-08, at 6:49 PM, Andrej van der Zee wrote: Hi, You hook child_init (ap_hook_child_init) and store your data in global variables that are accessed by post_read_request and log_transaction. BTW, in a worker-MPM, is child_init executed for every created worker-thread? Or is it pe

Regular expression matching for multi line strings...

2008-12-22 Thread Kevac Marko
Hello. ap_regexec() do not match multi line strings without AP_REG_NEWLINE flag, but it should. For example i have string: SELECT\r\nstate.SECNAME,\r\nstate.SHORTNAME,\r\n state.LATNAME,\r\nstate.DECIMALS,\r\nstate.PREVPRICE,\r\n realtime.BOARDID as BOARDID,\r\nrealtime.SECID

Re: process initialisation in prefork-MPM

2008-12-22 Thread Sander Temme
On Dec 22, 2008, at 4:48 AM, Sorin Manolache wrote: You hook child_init (ap_hook_child_init) and store your data in global variables that are accessed by post_read_request and log_transaction. Global variables are fine if your module will never run multithreaded, or you won't write to the

Re: process initialisation in prefork-MPM

2008-12-22 Thread Andrej van der Zee
Hi, > > Global variables are fine if your module will never run multithreaded, or > you won't write to the data structures from any potentially threaded > situation. > > If you want to be able to run multithreaded, you can mutex access to the > globals. If you want to decide at runtime, you can f