Re: Issuing a client side HTTP request from a module

2010-04-22 Thread Saju Pillai
Some Guy wrote: Hi all, Is there any facility in the Apache libs that allows module developers to act as a client? If not, I'll just use something like curl (or raw sockets), but wanted to know if there was an Apache way to do this. You'll have to co-opt a http client library or roll your

Re: LD_PRELOAD for modules

2010-03-27 Thread Saju Pillai
Andrej van der Zee wrote: Hi William, LoadFile Saving on ink aren't you ;) Thanks for the advise, I will give it a go soon. Just one question you might be able to answer. From the documentation it looks like LoadFile is used to add additional code. In my case, I need to override existing

Re: child_init for threads?

2009-03-19 Thread Saju Pillai
Andrej van der Zee wrote: Hi, Thanks, that helps! Since I am developing my modules in C++, I think I should be using this one: apr_status_t apr_thread_data_set( void * data, const char *key, apr_status_t(*)(void *) cleanup,

Re: child_init for threads?

2009-03-18 Thread Saju Pillai
Andrej van der Zee wrote: Hi, Thanks for your reply. AFAIK there's no support for such thing in apache. Have a look yourself in server/mpm/worker/worker.c. You can hook create_connection (the first hook offered by apache in a thread after its creation). However, create_connection is called

Re: Make HTTP Request

2009-03-16 Thread Saju Pillai
Sorin Manolache wrote: 2009/3/16 Arturo 'Buanzo' Busleiman bua...@buanzo.com.ar: -BEGIN PGP SIGNED MESSAGE- Hash: SHA512 Hi! From within my module, I'd like to make an HTTP request from another HTTP server, get something from it, and use the returned information. What's the best way

Re: custom background thread and module sharing a data structure

2009-03-13 Thread Saju Pillai
Andrej van der Zee wrote: Hi, Thanks for your comments. See below... Worker mpm is a multithreaded, multiprocess mpm. Multiple child processes host multiple worker threads that run your module code. If your module services 2 concurrent requests in 2 different threads in the same process and

Re: custom background thread and module sharing a data structure

2009-03-11 Thread Saju Pillai
Sorin Manolache wrote: On Wed, Mar 11, 2009 at 02:08, Andrej van der Zee andrejvander...@gmail.com wrote: Hi, I need to modify Apache and run one custom background thread. In addition, my custom modules have to be able to share a data structure with this background thread. Did anybody do this

Re: Asynchronous request processing

2009-03-09 Thread Saju Pillai
Supun Kamburugamuva wrote: Hi all, I'm writing a httpd module. This module is a content generator. When a request comes to this module it has to forward it to a remote machine. In that sense this module makes httpd acts like a proxy server. Talking to a remote machine can take some time and

Re: Asynchronous request processing

2009-03-09 Thread Saju Pillai
Supun Kamburugamuva wrote: Thanks for the quick reply. I have found this Event MPM for httpd. Is it possible to use this for my scenario? http://httpd.apache.org/docs/2.2/mod/event.html Only from reading the description, I would say that you will need to extend the mpm to meet your needs.

Re: Asynchronous request processing

2009-03-09 Thread Saju Pillai
Supun Kamburugamuva wrote: On Mon, Mar 9, 2009 at 3:24 PM, Saju Pillai saju.pil...@gmail.com wrote: Supun Kamburugamuva wrote: Thanks for the quick reply. I have found this Event MPM for httpd. Is it possible to use this for my scenario? http://httpd.apache.org/docs/2.2/mod/event.html

Re: handling client abort instantly?

2009-03-05 Thread Saju Pillai
Frank Meier wrote: thanks for your replies, I tried the use of bucketbrigades as Chris Kukuchka suggested. Unfortunately this lead to the same behaviour. I also tried the *hack* approach (accessing the socket directly), where I had the problem of getting to the socket itself. I didn't

Re: handling client abort instantly?

2009-03-03 Thread Saju Pillai
Frank Meier wrote: Hi I'm working with a proprietary apache module which communicates (through a socket) with another backend application (I have the C source code of the module). I've now found out, when the client closes the http connection during a request, the module does not see that the

Re: Need help with --activate-module

2009-02-05 Thread Saju Pillai
Shibu Narendranathan wrote: Hi All, I am trying to implement a proprietary encryption mechanism on an existing apache server. What is desired is the following. ClientServer --|- 1) sends

Re: multiple processes: but one module init needed

2009-01-25 Thread Saju Pillai
fka...@googlemail.com wrote: Hi all, some of the initialization tasks of my module must not be done repeatedly with each spawned server process. The post_config hook may help you. Currently I init my module by ap_hook_child_init() and do cleaning up by apr_pool_cleanup_register(), so each

Re: multiple processes: but one module init needed

2009-01-25 Thread Saju Pillai
fka...@googlemail.com wrote: fka...@googlemail.com: some of the initialization tasks of my module must not be done repeatedly with each spawned server process. To be more precise: There is only *one* vhost/configuration here, however, due to the mpm settings (see below) apache launches

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

Re: understanding apr_strtok()

2008-12-12 Thread Saju Pillai
2008/12/13 Saju Pillai saju.pil...@gmail.com: On 13-Dec-08, at 1:02 PM, Mark Harrison wrote: Sam Carleton wrote: I am trying to use apr_strtok() for the first time. I am taking the add_cookie() function from mod_rewrite.c, no changes. I am passing in the string, variable 's

Retrieving per_dir_config structures in post_config_hook

2008-11-27 Thread Saju Pillai
Greetings, In an apache 2.2 module, how can i retrieve all of it's per_dir config structures in the post_config hook ? Holding an explicit reference to each per_dir config structure (when it is allocated) within the module is possible but is slightly ugly. Is there a recommended way to

Re: PHP Extension Deinitializing on Startup

2007-04-20 Thread Saju Pillai
On 20/04/07, Joe Lewis [EMAIL PROTECTED] wrote: Michael B Allen wrote: Hi Saju, Actually I'm not sure this is my problem. I have tested my PHP extension on numerous platforms and I have only ever seen the PHP extension initialization / deinitialization routines run once for each restart.

Re: multiple c file problem with apxs.

2007-04-20 Thread Saju Pillai
Show us the compiler error. Maybe this is just a coding issue ? -srp On 19/04/07, Jason [EMAIL PROTECTED] wrote: Ok, Im getting a error with a module im trying to compile using apxs. What we have is two source files and a header. File number one compiles fine, but once we try to run a

Re: PHP Extension Deinitializing on Startup

2007-04-20 Thread Saju Pillai
The apache config cycle will load - unload - load your module on startup. Infact your module gets reloaded in for every restart -srp On 20/04/07, Michael B Allen [EMAIL PROTECTED] wrote: I'm trying to track down a strange problem. I have a PHP extension that is being deinitialized immediately

Re: Store data accessible by all process and threads.

2007-04-20 Thread Saju Pillai
This question seems more suitable for the modules list. Read Only data ? You may consider setting it up in post_config - alloc from config pool. Your data will get copied into all children. Read-Write data ? shm is ok. Any standard IPC should work. -srp On 20/04/07, moh bad [EMAIL PROTECTED]

Examining per_dir_config for a module

2007-04-12 Thread Saju Pillai
Greetings, I am attempting to write a apache 2.2 module that has per dir/location directives. I need to examine all the per dir/location module_config's for this mod. Can I do something like ... for (server = base_server; server; server = server-next) { conf =

Re: Event MPM accept() handling

2006-03-01 Thread Saju Pillai
On 01/03/06, Paul Querna [EMAIL PROTECTED] wrote: Greg Ames wrote: Saju Pillai wrote: I can understand why serializing apr_pollset_poll() accept() for the listener threads doesn't make sense in the event-mpm. A quick look through the code leaves me confused about the following ...It looks like

Re: Event MPM accept() handling

2006-03-01 Thread Saju Pillai
a request line is already available for reading ? i.e on bsd (maybe) we can get better benchmarks if accept() read() at the same time. regardssrpOn 01/03/06, Paul Querna [EMAIL PROTECTED] wrote: Saju Pillai wrote: On 01/03/06, *Paul Querna* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Greg Ames

Re: Event MPM accept() handling

2006-03-01 Thread Saju Pillai
On 01/03/06, Greg Ames [EMAIL PROTECTED] wrote: Saju Pillai wrote: For a brand new client connection, why should there be 2 exchanges between the listener thread and the worker thread before the request is actually read ? The client socket is accepted() and passed to a worker thread which runs

event_mpm and poll()

2006-03-01 Thread Saju Pillai
Greetings, The event mpm expects the apr_pollset backends to be based on epoll() / kqueue() or Solaris 10 event ports. What are the reasons because of which poll() is not considered to be suitable for the event mpm ? Is this because of the large number of fd's to be polled and linear

Re: event_mpm and poll()

2006-03-01 Thread Saju Pillai
On 02/03/06, Greg Ames [EMAIL PROTECTED] wrote: Paul Querna wrote:The event mpm expects the apr_pollset backends to be based on epoll() / kqueue() or Solaris 10 event ports. What are the reasons because of which poll() is not considered to be suitable for the event mpm ? Is this because of the

Re: event_mpm and poll()

2006-03-01 Thread Saju Pillai
On 02/03/06, Paul Querna [EMAIL PROTECTED] wrote: Saju Pillai wrote: On 02/03/06, *Greg Ames* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Paul Querna wrote:The event mpm expects the apr_pollset backends to be based on epoll() / kqueue() or Solaris 10 event ports. What are the reasons