Re: Shared memory - data between threads

2023-03-23 Thread Yann Ylavic
Hello; On Thu, Mar 23, 2023 at 11:48 AM Bob Weeks wrote: > > I created a little test module to just increment a value in this code > block each time I called the page and printout the next time it passed. > > ap_log_error(APLOG_MARK, APLOG_INFO,0,r->server,"Config = >

Re: child_init hook: Main vs. MPM processes

2020-12-14 Thread Yann Ylavic
Hi Florian, On Mon, Dec 14, 2020 at 12:11 PM Florian Wagner wrote: > > is there a simple way to detect in a child_init hook if the current > process is also the main server process (the one that runs the > pre_config hook). It depends on the MPMs your module is targeting. For unix MPMs (which

Re: TCP socket wothout HTTP protocol

2020-06-04 Thread Yann Ylavic
On Thu, Jun 4, 2020 at 12:26 PM Sébastien Mizrahi wrote: > > In apache, the ap_hook_process_connection is not called until content is sent > on socket, ap_hook_pre_connection and ap_hook_create_connection are called > only after 10 seconds in this case. I would like to have a hook called when

Re: SSLProxy* directives not working inside section

2018-06-26 Thread Yann Ylavic
Hi, On Tue, Jun 26, 2018 at 10:17 AM, Dominik Stillhard wrote: > According to documentation it should be possible to set SSLProxy* directives > inside a section. It should work starting with version 2.4.33. Which version are you using? > > When i put the SSLProxy directives on VHost-Level it

Re: How to read data in a request handler and then return DECLINED without consuming the data in the bucket brigade?

2018-06-04 Thread Yann Ylavic
On Mon, Jun 4, 2018 at 7:23 PM, Paul Callahan wrote: > > I did try with input filters. The reason I'm trying to do this in a > handler is because I want to return 403 to the browser if the request body > has something unsavory in it. With reverse proxied requests, it appears > the input filter

Re: Chunked request

2016-09-23 Thread Yann Ylavic
Hi, On Fri, Sep 23, 2016 at 12:59 PM, André Rothe wrote: > > Any ideas? It depends on whether your filter is called in blocking or non-blocking mode, i.e. the apr_read_type_e parameter value (either APR_BLOCK_READ or APR_NONBLOCK_READ). In the former case, your

Re: Cleanup when server is stopped vs reconfigured

2016-03-29 Thread Yann Ylavic
On Tue, Mar 29, 2016 at 3:01 AM, Tony Abo wrote: > > Is there a way to run some cleanup code in a module when the server is being > stopped, but not being restarted? Or, can a cleanup handler in a loaded > module determine whether the server is being shut down or restarted?

Re: apr_shm_create succeeds then fails on Mac OS X

2015-12-28 Thread Yann Ylavic
You could possible add a call to apr_shm_remove(shmfilename, pconf) (resp. shmfilename_delaypool) in the module's post_config, before the SHMs are created with apr_shm_create(). Regards, Yann. On Mon, Dec 28, 2015 at 2:56 PM, Jim Jagielski wrote: > Looks like the module is not

Re: Signal-safe way to start a worker thread in each child process?

2015-06-03 Thread Yann Ylavic
On Wed, Jun 3, 2015 at 7:55 PM, Jacob Champion jacob.champ...@ni.com wrote: In your opinion, is this worth filing a bug report over? That would probably help to remember that there is a request for it ;) Regards, Yann.

Re: Signal-safe way to start a worker thread in each child process?

2015-06-02 Thread Yann Ylavic
Hello, On Tue, Jun 2, 2015 at 9:15 PM, Jacob Champion jacob.champ...@ni.com wrote: We could just call apr_setup_signal_thread() ourselves -- and doing that does fix the problem -- but that means that modules which are initialized after us will get the global protection too, which doesn't

Re: How to wait on a global lock with timeout

2015-05-16 Thread Yann Ylavic
Hi Micha, On Sat, May 16, 2015 at 5:22 PM, Micha Lenk mi...@lenk.info wrote: Sorry, took me a while to give your patch a try. As the patch didn't apply cleanly to trunk (ie. SVN rev. 1676013), I assume that it is already applied in trunk. So I went ahead without applying your patch. Is this

Re: Share data between apache modules

2015-05-10 Thread Yann Ylavic
Hi Eugene, this should work... We need more of your code and/or logging to figure out what's going on. Maybe could you also log r and r-notes (with format %pp) to see if the two modules really share the same request? Regards, Yann. On Sat, May 9, 2015 at 6:40 PM, Eugene Teslenko

Re: Share data between apache modules

2015-05-10 Thread Yann Ylavic
, r_main_pp=0, handler=application/x-httpd-php56 [Sun May 10 19:22:05 2015] [...] mod_a[81136]: r_pp=845056028, r_main_pp=0, handler=fastcgi-script [Sun May 10 19:22:07 2015] [...] mod_b[81136]: test-var=test-string, r_pp=84505f0a0, handler=(null) 2015-05-10 18:04 GMT+03:00 Yann Ylavic ylavic

Re: Share data between apache modules

2015-05-10 Thread Yann Ylavic
+03:00 Yann Ylavic ylavic@gmail.com: Hi Eugene, this should work... We need more of your code and/or logging to figure out what's going on. Maybe could you also log r and r-notes (with format %pp) to see if the two modules really share the same request? Regards, Yann.

Re: How to wait on a global lock with timeout

2015-03-25 Thread Yann Ylavic
Hi Micha, thanks for the review. On Wed, Mar 25, 2015 at 7:19 AM, Micha Lenk mi...@lenk.info wrote: I only had time to review the code changes. I looked at the implementation of apr_global_mutex_timedlock(). There I noticed that, if APR_HAS_THREADS, you are doing 3 timed operations without

Re: How to wait on a global lock with timeout

2015-03-19 Thread Yann Ylavic
://svn.apache.org/r1667900 [2] http://svn.apache.org/r1667901 On Tue, Sep 30, 2014 at 8:22 PM, Micha Lenk mi...@lenk.info wrote: Hi Yann, On 30.09.2014 18:16, Yann Ylavic wrote: On Tue, Sep 30, 2014 at 5:30 PM, Yann Ylavic ylavic@gmail.com wrote: I have been working on a patch to provide

Re: Debugging mod_websocket -- any others out there?

2015-03-03 Thread Yann Ylavic
On Tue, Mar 3, 2015 at 10:00 PM, Jacob Champion jacob.champ...@ni.com wrote: I'm waiting on internal approval to post the five-patch set here (unless of course there is any objection from the mailing list; I don't see a lot of patch mail in the archives). Please post here so that people

Re: Preventing Path Traversal Attack

2014-12-08 Thread Yann Ylavic
Hi Justin, On Mon, Dec 8, 2014 at 3:07 PM, Justin Kennedy jkenn...@pingidentity.com wrote: The variable r is the request_rec that is passed into the module's handler hook. Based on my testing, r-unparsed_uri does indeed have a space (it's not encoded to %20). As I said in my previous message,

Re: Preventing Path Traversal Attack

2014-12-08 Thread Yann Ylavic
On Mon, Dec 8, 2014 at 4:30 PM, Yann Ylavic ylavic@gmail.com wrote: I need to compare against an unparsed URI because r-uri is vulnerable to a path traversal attack. For instance, this: http://abc.me/unprotected_path/../protected_path becomes: http://abc.me/protected_path I don't see

Re: problem with shared memory and directives for httpd

2014-12-04 Thread Yann Ylavic
Hi, to not depend on where you declare : IfModule mod_kcache.c KcacheEnabled On /IfModule you need to iterate over the server_rec list in post_config and child_init hooks. Please see attached modifications (where only a server_config is used). Regards, Yann. On Thu, Dec 4, 2014 at

Re: problem with shared memory and directives for httpd

2014-12-04 Thread Yann Ylavic
On Thu, Dec 4, 2014 at 10:52 PM, Yann Ylavic ylavic@gmail.com wrote: Please see attached modifications (where only a server_config is used). Note that I did not even test compile the chages, just a POC...

Re: How to wait on a global lock with timeout

2014-09-30 Thread Yann Ylavic
Hi Micha, On Mon, Sep 29, 2014 at 3:18 PM, Micha Lenk mi...@lenk.info wrote: in an Apache module I am in the need to wait for a global lock (e.g. an apr_global_mutex_t), but in theory the lock might not get released by the other process in a timely manner, so I would like to limit the time to

Re: How to wait on a global lock with timeout

2014-09-30 Thread Yann Ylavic
On Tue, Sep 30, 2014 at 5:30 PM, Yann Ylavic ylavic@gmail.com wrote: I have been working on a patch to provide apr_[thread/proc]_mutex_timedlock() in APR, but did not finish the work mostly because of APR_ENOTIMPL on some mutex mechanisms (mainly Windows CRITICAL_SECTIONs which lack