RE: Making mod_auth_digest mysql
I don't drink that frequently, but when I do I get chatty, even on the computer. -Original Message- From: Ray Morris [mailto:supp...@bettercgi.com] Sent: Sunday, February 08, 2009 8:00 PM To: modules-dev@httpd.apache.org Subject: Re: Making mod_auth_digest mysql Sorry, about the extraneous personal notes. The I love you was an exaggeration of thank you. I kid around. I don't know that people understand that. No problem - I get a lot of that. :) I should never go near a computer when I'm drinking. I also type stuff I regret. It used to be I shouldn't go around ANYTHING when I was drinking, which was pretty often! Then thirteen years ago I found a way that I don't need to drink like that any more, thankfully. -- Ray B. Morris supp...@bettercgi.com Strongbox - The next generation in site security: http://www.bettercgi.com/strongbox/ Throttlebox - Intelligent Bandwidth Control http://www.bettercgi.com/throttlebox/ Strongbox / Throttlebox affiliate program: http://www.bettercgi.com/affiliates/user/register.php On 02/08/2009 09:05:54 AM, Michele Waldman wrote: Sorry, about the extraneous personal notes. The I love you was an exaggeration of thank you. I kid around. I don't know that people understand that. I had already started drinking in celebration of finishing my project. I should never go near a computer when I'm drinking. I also type stuff I regret. Thank you again. But, I have to know how does RewriteCond ${REMOTE_USER} . Is the . for any character? Why does it evaluate correctly when undefined and != doesn't? Michele -Original Message- From: Ray Morris [mailto:supp...@bettercgi.com] Sent: Friday, February 06, 2009 3:05 PM To: modules-dev@httpd.apache.org Subject: Re: Making mod_auth_digest mysql I'm thinking about adding a -e flag for environment variable does not exist to httpd on my server. It would return true if the variable exists or false, otherwise. Is there a way to already do this? For your purpose, you can use: RewriteCond %{REMOTE_USER} !. or as appropriate: RewriteCond %{REMOTE_USER} . That will check for any non-empty value by matching at least any single character. It looks like: RewriteCond ${REMOTE_USER} != always evaluates to true if REMOTE_USER does not exist. Am I wrong? That's correct, if it doesn't exist, it's not the empty string. What's in that bucket on your desk? There is no bucket is a different answer than the bucket is empty. Since you apparently understand SQL, let me explain that by saying it's the same thing as the difference between trying to get the value of a column which doesn't exist, which is an outright error, versus a column with the value 0, versus a text column with empty text (), versus an unknown value, represented by NULL. Not existing isn't the same thing as existing and being empty. -- Ray B. Morris supp...@bettercgi.com Strongbox - The next generation in site security: http://www.bettercgi.com/strongbox/ Throttlebox - Intelligent Bandwidth Control http://www.bettercgi.com/throttlebox/ Strongbox / Throttlebox affiliate program: http://www.bettercgi.com/affiliates/user/register.php On 02/05/2009 10:43:57 PM, Michele Waldman wrote: RewriteCond has flags -f -d ... But not -e for exists. It looks like: RewriteCond ${REMOTE_USER} != always evaluates to true if REMOTE_USER does not exist. Am I wrong? I'm thinking about adding a -e flag for environment variable does not exist to httpd on my server. It would return true if the variable exists or false, otherwise. Is there a way to already do this? Thoughts? Michele
Re: svn commit: r741947 - in /httpd/httpd/trunk/modules/mappers: config9.m4 mod_watchdog.c mod_watchdog.h
On 02/07/2009 08:51 PM, mt...@apache.org wrote: Author: mturk Date: Sat Feb 7 19:51:52 2009 New Revision: 741947 URL: http://svn.apache.org/viewvc?rev=741947view=rev Log: Add watchdog module Added: httpd/httpd/trunk/modules/mappers/mod_watchdog.c (with props) httpd/httpd/trunk/modules/mappers/mod_watchdog.h (with props) Modified: httpd/httpd/trunk/modules/mappers/config9.m4 Added: httpd/httpd/trunk/modules/mappers/mod_watchdog.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_watchdog.c?rev=741947view=auto == +/*--*/ +/* */ +/* Main watchdog worker thread. */ +/* For singleton workers child thread theat first obtains the process */ +/* mutex is running. Threads in other child's are locked on mutex. */ +/* */ +/*--*/ +static void* APR_THREAD_FUNC wd_worker(apr_thread_t *thread, void *data) +{ +ap_watchdog_t *w = (ap_watchdog_t *)data; +apr_status_t rv; +int locked = 0; +int probed = 0; +int inited = 0; + +w-pool = apr_thread_pool_get(thread); +w-is_running = 1; + +apr_thread_mutex_unlock(w-startup); +if (w-mutex) { +while (w-is_running) { +rv = apr_proc_mutex_trylock(w-mutex); +if (rv == APR_SUCCESS) { +if (probed) { +/* Sleep after we were locked + * up to 1 second. Httpd can be + * in the middle of shutdown, and + * our child didn't yet received + * the shutdown signal. + */ +probed = 10; +while (w-is_running probed 0) { +apr_sleep(AP_WD_TM_INTERVAL); +probed--; +} +} +locked = 1; +break; +} +probed = 1; +apr_sleep(AP_WD_TM_SLICE); +} +} +if (w-is_running) { +watchdog_list_t *wl = w-callbacks; +ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, wd_server_conf-s, + %sWatchdog (%s) running (%d), + w-singleton ? Singleton : , + w-name, getpid()); +apr_time_clock_hires(w-pool); +if (wl) { +apr_pool_t *ctx = NULL; +apr_pool_create(ctx, w-pool); +while (wl w-is_running) { +/* Execute watchdog callback */ +wl-status = (*wl-callback_fn)(AP_WATCHDOG_STATE_STARTING, +(void *)wl-data, ctx); +wl = wl-next; +} +apr_pool_destroy(ctx); +} +else { +ap_run_watchdog_init(wd_server_conf-s, w-name, w-pool); +inited = 1; +} +} + +/* Main execution loop */ +while (w-is_running) { +apr_pool_t *ctx = NULL; +apr_time_t curr; +watchdog_list_t *wl = w-callbacks; + +apr_sleep(AP_WD_TM_SLICE); +if (!w-is_running) { +break; +} +curr = apr_time_now() - AP_WD_TM_SLICE; +while (wl w-is_running) { +if (wl-status == APR_SUCCESS) { +wl-step += (apr_time_now() - curr); +if (wl-step = wl-interval) { +if (!ctx) Is this check really needed? ctx should be always NULL here. +apr_pool_create(ctx, w-pool); +wl-step = 0; +/* Execute watchdog callback */ +wl-status = (*wl-callback_fn)(AP_WATCHDOG_STATE_RUNNING, +(void *)wl-data, ctx); +} +} +wl = wl-next; +} +if (w-is_running w-callbacks == NULL) { +/* This is hook mode watchdog + * running on WatchogInterval + */ +w-step += (apr_time_now() - curr); +if (w-step = wd_interval) { +if (!ctx) +apr_pool_create(ctx, w-pool); Is this check really needed? ctx should be always NULL here. +w-step = 0; +/* Run watchdog step hook */ +ap_run_watchdog_step(wd_server_conf-s, w-name, ctx); +} +} +if (ctx) +apr_pool_destroy(ctx); +if (!w-is_running) { +break; +} +} +
Re: svn commit: r741947 - in /httpd/httpd/trunk/modules/mappers: config9.m4 mod_watchdog.c mod_watchdog.h
On 02/07/2009 08:51 PM, mt...@apache.org wrote: Author: mturk Date: Sat Feb 7 19:51:52 2009 New Revision: 741947 URL: http://svn.apache.org/viewvc?rev=741947view=rev Log: Add watchdog module Added: httpd/httpd/trunk/modules/mappers/mod_watchdog.c (with props) httpd/httpd/trunk/modules/mappers/mod_watchdog.h (with props) Modified: httpd/httpd/trunk/modules/mappers/config9.m4 Minor nit: mod_watchdog.c: In function 'wd_post_config_hook': mod_watchdog.c:426: warning: unused variable 'lk' Regards Rüdiger
Documentation request for review
Greetings, While reviewing Lucien's french translation for the trunk performance tuning guide (misc/perf-tuning.xml), it has come to my understanding that this document contains extremely old, and probably outdated, information. URL for the HTML version is http://httpd.apache.org/docs/trunk/misc/perf-tuning.html Of course the document already contains a warning about being irrelevant. Some sections of the document refer to Apache 1.2 ; my favorite extract is probably : As HTTP/1.1 becomes more prevalent, and all connections are persistent, this expense will be amortized over more requests.. Also, a very long section speaks about performance problems when multiple Listen directives are set. I would think this has been addressed by issuing internal requests (or has it not ?) I am not competent to review the content of this document myself, but I think it deserves it. It would be extremely nice if a developer who knows about these could take a bit of time to remove oldies from that page. BR, Vincent PS : however, since the french translation is done and reviewed, I just commited it.
Re: Using gzip and CustomLog
On 28.01.2009 06:50, Paras Fadte wrote: I have somewhat modified the rotatlogs utility to support compression . Although it creates files in compressed format (.gz) and rotates them properly the issue that i am facing is that when apache is restarted (graceful or stop/start way ) the last created compressed file doesn't seem to get closed . Is there a way to rectify this ? For compression I am using zlib . When httpd is restarted or stopped, then most rotatelogs processes get stopped via a signal. The signal could depend on the platform, but in my case it's SIGTERM. You can truss your rotatelogs to verify yourself, whether that's true for your Linux system too. truss will show you the signal the rotatelogs process received before terminating. Then you need to register a signal handler, e.g. apr_signal(SIG_TERM, my_signal_handler); which gets called automatically, whenever the process receives the respective signal. Your signal handler my_signal_handler() could then set an internal flag, indicating that you want to cleanup and exit rotatelogs. You can check this flag before and after the blocking read from the log pipe, and if it is set, close your gzip output cleanly and exit rotatelogs. You can temporarily deactivate or activate all signal handlers for SIG_TERM with apr_signal_unblock(SIG_TERM); and apr_signal_block(SIG_TERM); The ErrorLog for the global server behaves a little different, when restarting Apache it doesn't get a signal but instead it will get an EPIPE when trying to read from the log pipe. Regards, Rainer On Fri, Jan 23, 2009 at 1:41 PM, Paras Fadteplf...@gmail.com wrote: Thanks Rainer, yeah.. me not a pro at development . On Fri, Jan 23, 2009 at 1:30 PM, Rainer Jungrainer.j...@kippdata.de wrote: On 23.01.2009 08:45, Paras Fadte wrote: Can you please tell me in which file ? I assume you are building rotatelogs from within the httpd sources. There is a file support/Makefile, which contains a line $(LINK) $(rotatelogs_LTFLAGS) $(rotatelogs_OBJECTS) $(PROGRAM_LDADD) Simply add -lz at the end of the line: $(LINK) $(rotatelogs_LTFLAGS) $(rotatelogs_OBJECTS) $(PROGRAM_LDADD) -lz In case you don't know what a Makefile is and how it basically works, you need to read about how to do C software development. Regards, Rainer On Fri, Jan 23, 2009 at 1:09 PM, Rainer Jungrainer.j...@kippdata.de wrote: On 23.01.2009 07:55, Paras Fadte wrote: Hi, I get following error when I try to use compress function of zlib in rotatelogs.c . I have included zlib.h in rotatelogs.c . /home/paras/httpd-2.0.55/support/rotatelogs.c:294: undefined reference to `compress' collect2: ld returned 1 exit status Is it linking error ? where should I make the changes to eliminate this error? Add -lz to the linking flags.
Unix line ends in Windows DSP files
Hi, all Windows DSP files in trunk, except for the recent ones for mod_sed and mod_proxy_fcgi, have Unix line ends, even when checked out on Windows. The eol-style is set to native (no difference with the sed or proxy_fcgi one). I assume they have been checked in from Windows but with Unix line ends. Is there a reason for this, e.g. they are generated/exported automatically and will again have Unix line ends after the next regeneration? If not, I'll convert all of them to Windows, not changing the eol-style native though. This saves one step when building httpd on Windows. Regards, Rainer
Re: Getting pool associated with current thread/child
On Sat, Feb 7, 2009 at 5:47 PM, Graham Leggett minf...@sharp.fm wrote: Brian McCallister wrote: So, in mod_lua I need to get the apr pool associated with the current thread (that being the main thread if in prefork). What about the process_rec structure? In other words, r-server-process-pool? I thought this was one-per-process, where process is a real process. I need one-per-thread in in worker/event so that they don't step on each other. What I am looking for is to attach a lua_State instance to that pool, so that when the thread is retired, I can hook into cleanups, and so that I can attach the lua_State to the pool as userdata, to retrieve it later. In prefork, a process level pool would work fine, but AFAIK this is not a thread-safe thing. (Not sure if this is what you are looking for, but a quick glance at the headers would suggest it probably does). Regards, Graham --
Re: Documentation request for review
Vincent Deffontaines wrote on 2009-02-08 13:20:23: While reviewing Lucien's french translation for the trunk performance tuning guide (misc/perf-tuning.xml), it has come to my understanding that this document contains extremely old, and probably outdated, information. Yes, this page is really *really* outdated. IMHO we should consider removing it or at least adding a note that the stuff is outdated. ciao... -- Lars Eilebrecht l...@eilebrecht.net
Re: use of APR_SENDFILE_ENABLED in mod_disk_cache
Ruediger Pluem wrote on 2009-02-07 22:03:38: IMHO this is correct. The problem is that we do not know at this point of time how EnableSendFile is set. We are in the quick handler and have not done any directory walks (and in fact if the cached entry is good we never will). So the only option I see here is to add another directive for mod_disk_cache to determine what should be done. Well, but if EnableSendfile is configured in the main config or vhost we get the setting by looking at the core_module config. Of course you are right that this doesn't work when it is defined inside a Location or Directory section. We could just add a note to the mod_disk_cache configuration that EnableSendfile will only be taken into account when configured globally for the server or vhost. IMHO that's good enough for such a special case. I would like to avoid a dedicated sendfile directive just for mod_disk_cache. ciao... -- Lars Eilebrecht l...@eilebrecht.net
Re: Getting pool associated with current thread/child
An alternative, for my need, is to be able to add a cleanup hook to the current thread. I can then just create a pool and put it in a thread local (you can do that with just the os thread in apr). I cannot find a way to actually register a cleanup for the threadlocal you set, though. Is there one which I am missing? On Sun, Feb 8, 2009 at 10:22 AM, Brian McCallister bri...@skife.org wrote: On Sat, Feb 7, 2009 at 5:47 PM, Graham Leggett minf...@sharp.fm wrote: Brian McCallister wrote: So, in mod_lua I need to get the apr pool associated with the current thread (that being the main thread if in prefork). What about the process_rec structure? In other words, r-server-process-pool? I thought this was one-per-process, where process is a real process. I need one-per-thread in in worker/event so that they don't step on each other. What I am looking for is to attach a lua_State instance to that pool, so that when the thread is retired, I can hook into cleanups, and so that I can attach the lua_State to the pool as userdata, to retrieve it later. In prefork, a process level pool would work fine, but AFAIK this is not a thread-safe thing. (Not sure if this is what you are looking for, but a quick glance at the headers would suggest it probably does). Regards, Graham --
Re: use of APR_SENDFILE_ENABLED in mod_disk_cache
On 02/08/2009 09:35 PM, Lars Eilebrecht wrote: Ruediger Pluem wrote on 2009-02-07 22:03:38: IMHO this is correct. The problem is that we do not know at this point of time how EnableSendFile is set. We are in the quick handler and have not done any directory walks (and in fact if the cached entry is good we never will). So the only option I see here is to add another directive for mod_disk_cache to determine what should be done. Well, but if EnableSendfile is configured in the main config or vhost we get the setting by looking at the core_module config. Of course you are right that this doesn't work when it is defined inside a Location or Directory section. Well I am not sure if the core_dir_config structure is already setup during the quick handler phase (even for settings done on VHOST level). Regards Rüdiger
Re: use of APR_SENDFILE_ENABLED in mod_disk_cache
Ruediger Pluem wrote on 2009-02-08 22:36:47: Well, but if EnableSendfile is configured in the main config or vhost we get the setting by looking at the core_module config. Of course you are right that this doesn't work when it is defined inside a Location or Directory section. Well I am not sure if the core_dir_config structure is already setup during the quick handler phase (even for settings done on VHOST level). Yes, it is. The following seems to work fine: Index: mod_disk_cache.c === --- mod_disk_cache.c(revision 742187) +++ mod_disk_cache.c(working copy) @@ -471,7 +471,10 @@ /* Open the data file */ flags = APR_READ|APR_BINARY; #ifdef APR_SENDFILE_ENABLED -flags |= APR_SENDFILE_ENABLED; +core_dir_config *coreconf = ap_get_module_config(r-per_dir_config, + core_module); +flags |= ((coreconf-enable_sendfile == ENABLE_SENDFILE_OFF) + ? 0 : APR_SENDFILE_ENABLED); #endif rc = apr_file_open(dobj-fd, dobj-datafile, flags, 0, r-pool); if (rc != APR_SUCCESS) { Unless this gets a -1 from anyone I'll commit this to trunk together with an appropriate note in the documentation. ciao... -- Lars Eilebrecht l...@eilebrecht.net
Re: use of APR_SENDFILE_ENABLED in mod_disk_cache
On 02/08/2009 11:38 PM, Lars Eilebrecht wrote: Ruediger Pluem wrote on 2009-02-08 22:36:47: Well, but if EnableSendfile is configured in the main config or vhost we get the setting by looking at the core_module config. Of course you are right that this doesn't work when it is defined inside a Location or Directory section. Well I am not sure if the core_dir_config structure is already setup during the quick handler phase (even for settings done on VHOST level). Yes, it is. The following seems to work fine: Index: mod_disk_cache.c === --- mod_disk_cache.c (revision 742187) +++ mod_disk_cache.c (working copy) @@ -471,7 +471,10 @@ /* Open the data file */ flags = APR_READ|APR_BINARY; #ifdef APR_SENDFILE_ENABLED -flags |= APR_SENDFILE_ENABLED; +core_dir_config *coreconf = ap_get_module_config(r-per_dir_config, + core_module); This is not ANSI C compatible. Please declare coreconf at the beginning of the block. Otherwise no objections. Regards Rüdiger
Re: Getting pool associated with current thread/child
Brian McCallister wrote: An alternative, for my need, is to be able to add a cleanup hook to the current thread. I can then just create a pool and put it in a thread local (you can do that with just the os thread in apr). I cannot find a way to actually register a cleanup for the threadlocal you set, though. Is there one which I am missing? no, because there isn't a portable way to do it, and in addition it would be an out of order pool destruction with the other pools, likely causing other issues. I think doing it via the mpm/extending the request rec is the right way to do it, and I don't understand why there is resistance to just doing it that way? On Sun, Feb 8, 2009 at 10:22 AM, Brian McCallister bri...@skife.org wrote: On Sat, Feb 7, 2009 at 5:47 PM, Graham Leggett minf...@sharp.fm wrote: Brian McCallister wrote: So, in mod_lua I need to get the apr pool associated with the current thread (that being the main thread if in prefork). What about the process_rec structure? In other words, r-server-process-pool? I thought this was one-per-process, where process is a real process. I need one-per-thread in in worker/event so that they don't step on each other. What I am looking for is to attach a lua_State instance to that pool, so that when the thread is retired, I can hook into cleanups, and so that I can attach the lua_State to the pool as userdata, to retrieve it later. In prefork, a process level pool would work fine, but AFAIK this is not a thread-safe thing. (Not sure if this is what you are looking for, but a quick glance at the headers would suggest it probably does). Regards, Graham --
Re: Getting pool associated with current thread/child
On Sun, Feb 8, 2009 at 3:54 PM, Paul Querna c...@force-elite.com wrote: I think doing it via the mpm/extending the request rec is the right way to do it, and I don't understand why there is resistance to just doing it that way? I don't think there is resistance, it is just a chunk of code *I* am not comfortable making changes to as I do not grok it, yet. If you make such a change, or can point me to something to explain how they work, it seems like a good approach -- we'll just need to document that it is not safe to hold onto the pool if you use it. -Brian On Sun, Feb 8, 2009 at 10:22 AM, Brian McCallister bri...@skife.org wrote: On Sat, Feb 7, 2009 at 5:47 PM, Graham Leggett minf...@sharp.fm wrote: Brian McCallister wrote: So, in mod_lua I need to get the apr pool associated with the current thread (that being the main thread if in prefork). What about the process_rec structure? In other words, r-server-process-pool? I thought this was one-per-process, where process is a real process. I need one-per-thread in in worker/event so that they don't step on each other. What I am looking for is to attach a lua_State instance to that pool, so that when the thread is retired, I can hook into cleanups, and so that I can attach the lua_State to the pool as userdata, to retrieve it later. In prefork, a process level pool would work fine, but AFAIK this is not a thread-safe thing. (Not sure if this is what you are looking for, but a quick glance at the headers would suggest it probably does). Regards, Graham --
Re: Getting pool associated with current thread/child
Brian McCallister wrote: On Sun, Feb 8, 2009 at 3:54 PM, Paul Querna c...@force-elite.com wrote: I think doing it via the mpm/extending the request rec is the right way to do it, and I don't understand why there is resistance to just doing it that way? I don't think there is resistance, it is just a chunk of code *I* am not comfortable making changes to as I do not grok it, yet. If you make such a change, or can point me to something to explain how they work, it seems like a good approach -- we'll just need to document that it is not safe to hold onto the pool if you use it. r742218 adds conn_rec::current_thread, and implements support for it on all the common Unix MPMs. It turns out its really hard to use the request_rec in the MPMs, but yet again its in trouble of where we draw the lines between MPMs and everything else.
Re: Making mod_auth_digest mysql
Sorry, about the extraneous personal notes. The I love you was an exaggeration of thank you. I kid around. I don't know that people understand that. No problem - I get a lot of that. :) I should never go near a computer when I'm drinking. I also type stuff I regret. It used to be I shouldn't go around ANYTHING when I was drinking, which was pretty often! Then thirteen years ago I found a way that I don't need to drink like that any more, thankfully. -- Ray B. Morris supp...@bettercgi.com Strongbox - The next generation in site security: http://www.bettercgi.com/strongbox/ Throttlebox - Intelligent Bandwidth Control http://www.bettercgi.com/throttlebox/ Strongbox / Throttlebox affiliate program: http://www.bettercgi.com/affiliates/user/register.php On 02/08/2009 09:05:54 AM, Michele Waldman wrote: Sorry, about the extraneous personal notes. The I love you was an exaggeration of thank you. I kid around. I don't know that people understand that. I had already started drinking in celebration of finishing my project. I should never go near a computer when I'm drinking. I also type stuff I regret. Thank you again. But, I have to know how does RewriteCond ${REMOTE_USER} . Is the . for any character? Why does it evaluate correctly when undefined and != doesn't? Michele -Original Message- From: Ray Morris [mailto:supp...@bettercgi.com] Sent: Friday, February 06, 2009 3:05 PM To: modules-...@httpd.apache.org Subject: Re: Making mod_auth_digest mysql I'm thinking about adding a -e flag for environment variable does not exist to httpd on my server. It would return true if the variable exists or false, otherwise. Is there a way to already do this? For your purpose, you can use: RewriteCond %{REMOTE_USER} !. or as appropriate: RewriteCond %{REMOTE_USER} . That will check for any non-empty value by matching at least any single character. It looks like: RewriteCond ${REMOTE_USER} != always evaluates to true if REMOTE_USER does not exist. Am I wrong? That's correct, if it doesn't exist, it's not the empty string. What's in that bucket on your desk? There is no bucket is a different answer than the bucket is empty. Since you apparently understand SQL, let me explain that by saying it's the same thing as the difference between trying to get the value of a column which doesn't exist, which is an outright error, versus a column with the value 0, versus a text column with empty text (), versus an unknown value, represented by NULL. Not existing isn't the same thing as existing and being empty. -- Ray B. Morris supp...@bettercgi.com Strongbox - The next generation in site security: http://www.bettercgi.com/strongbox/ Throttlebox - Intelligent Bandwidth Control http://www.bettercgi.com/throttlebox/ Strongbox / Throttlebox affiliate program: http://www.bettercgi.com/affiliates/user/register.php On 02/05/2009 10:43:57 PM, Michele Waldman wrote: RewriteCond has flags -f -d ... But not -e for exists. It looks like: RewriteCond ${REMOTE_USER} != always evaluates to true if REMOTE_USER does not exist. Am I wrong? I'm thinking about adding a -e flag for environment variable does not exist to httpd on my server. It would return true if the variable exists or false, otherwise. Is there a way to already do this? Thoughts? Michele
Re: Getting pool associated with current thread/child
On Sun, Feb 8, 2009 at 4:59 PM, Paul Querna c...@force-elite.com wrote: r742218 adds conn_rec::current_thread, and implements support for it on all the common Unix MPMs. It turns out its really hard to use the request_rec in the MPMs, but yet again its in trouble of where we draw the lines between MPMs and everything else. conn_rec is thread safe relative to the request_rec, so has same effect :-) Thanks! -Brian
Re: Getting pool associated with current thread/child
On Sun, Feb 8, 2009 at 5:05 PM, Brian McCallister bri...@skife.org wrote: On Sun, Feb 8, 2009 at 4:59 PM, Paul Querna c...@force-elite.com wrote: r742218 adds conn_rec::current_thread, and implements support for it on all the common Unix MPMs. It turns out its really hard to use the request_rec in the MPMs, but yet again its in trouble of where we draw the lines between MPMs and everything else. conn_rec is thread safe relative to the request_rec, so has same effect :-) Speaking of, what is general policy on breaking modules re non-unix stuff? Is there any #define I can make use of to protect non-*nix stuff from it until the other mpms support it? -Brian Thanks! -Brian
Re: Getting pool associated with current thread/child
Brian McCallister wrote: On Sun, Feb 8, 2009 at 5:05 PM, Brian McCallister bri...@skife.org wrote: On Sun, Feb 8, 2009 at 4:59 PM, Paul Querna c...@force-elite.com wrote: r742218 adds conn_rec::current_thread, and implements support for it on all the common Unix MPMs. It turns out its really hard to use the request_rec in the MPMs, but yet again its in trouble of where we draw the lines between MPMs and everything else. conn_rec is thread safe relative to the request_rec, so has same effect :-) Speaking of, what is general policy on breaking modules re non-unix stuff? Is there any #define I can make use of to protect non-*nix stuff from it until the other mpms support it? No, but I looked at taking a stab at the winnt MPM, hoping it would be an easy fix, but it gets complicated because it doesn't have a root pool for the thread, only a ptrans for the connection, which mean the patch needs to be more complicated than exposing already created pools. -Paul
Re: Getting pool associated with current thread/child
On Sun, Feb 8, 2009 at 5:05 PM, Brian McCallister bri...@skife.org wrote: On Sun, Feb 8, 2009 at 4:59 PM, Paul Querna c...@force-elite.com wrote: r742218 adds conn_rec::current_thread, and implements support for it on all the common Unix MPMs. It turns out its really hard to use the request_rec in the MPMs, but yet again its in trouble of where we draw the lines between MPMs and everything else. conn_rec is thread safe relative to the request_rec, so has same effect :-) Actually, is this a true statement? -Brian (who thinks processes should be enough) Thanks! -Brian
Re: Getting pool associated with current thread/child
Brian McCallister wrote: On Sun, Feb 8, 2009 at 5:05 PM, Brian McCallister bri...@skife.org wrote: On Sun, Feb 8, 2009 at 4:59 PM, Paul Querna c...@force-elite.com wrote: r742218 adds conn_rec::current_thread, and implements support for it on all the common Unix MPMs. It turns out its really hard to use the request_rec in the MPMs, but yet again its in trouble of where we draw the lines between MPMs and everything else. conn_rec is thread safe relative to the request_rec, so has same effect :-) Actually, is this a true statement? Yes, a request_rec always has the same conn_rec, a conn_rec might just be referenced from multiple request_recs, but requests are always executed in serial on a single connection.
Re: svn commit: r741947 - in /httpd/httpd/trunk/modules/mappers: config9.m4 mod_watchdog.c mod_watchdog.h
Ruediger Pluem wrote: +} +if (w-is_running w-callbacks == NULL) { +/* This is hook mode watchdog + * running on WatchogInterval + */ +w-step += (apr_time_now() - curr); +if (w-step = wd_interval) { +if (!ctx) +apr_pool_create(ctx, w-pool); Is this check really needed? ctx should be always NULL here. Yes, it's NULL, but only for the first callback. If there are multiple callbacks they will all use the same pool for this call. Also, pool gets created only if one of the callbacks actually times out. + +/* This mutex fixes problems with a fast start/fast end, where the pool + * cleanup was being invoked before the thread completely spawned. + */ Can you elaborate this a bit more (maybe with an example)? I currently do not understand which problem is solved here. Well, I reused the mod_heartbeat code here, and I think it's very useful to ensure the thread actually gets created and running before we allow to kill the child. +apr_thread_mutex_lock(w-startup); + +/* Start the newly created watchdog */ +rc = apr_thread_create(w-thread, NULL, wd_worker, w, p); +if (rc) { +apr_pool_cleanup_kill(p, w, wd_worker_cleanup); I don't see that this cleanup gets registered anywhere. That got slipped during copy/paste from my dev branch. Fixed, thanks. Regards -- ^(TM)
Bug report for Apache httpd-1.3 [2009/02/08]
+---+ | Bugzilla Bug ID | | +-+ | | Status: UNC=Unconfirmed NEW=New ASS=Assigned| | | OPN=ReopenedVER=Verified(Skipped Closed/Resolved) | | | +-+ | | | Severity: BLK=Blocker CRI=Critical REG=Regression MAJ=Major | | | | MIN=Minor NOR=NormalENH=Enhancement TRV=Trivial | | | | +-+ | | | | Date Posted | | | | | +--+ | | | | | Description | | | | | | | |10744|New|Nor|2002-07-12|suexec might fail to open log file| |10747|New|Maj|2002-07-12|ftp SIZE command and 'smart' ftp servers results i| |10760|New|Maj|2002-07-12|empty ftp directory listings from cached ftp direc| |14518|Opn|Reg|2002-11-13|QUERY_STRING parts not incorporated by mod_rewrite| |16013|Opn|Nor|2003-01-13|Fooling mod_autoindex + IndexIgnore | |16631|Inf|Min|2003-01-31|.htaccess errors logged outside the virtual host l| |17318|Inf|Cri|2003-02-23|Abend on deleting a temporary cache file if proxy | |19279|Inf|Min|2003-04-24|Invalid chmod options in solaris build| |21637|Inf|Nor|2003-07-16|Timeout causes a status code of 200 to be logged | |21777|Inf|Min|2003-07-21|mod_mime_magic doesn't handle little gif files| |22618|New|Maj|2003-08-21|MultiViews invalidates PATH_TRANSLATED if cgi-wrap| |25057|Inf|Maj|2003-11-27|Empty PUT access control in .htaccess overrides co| |26126|New|Nor|2004-01-14|mod_include hangs with request body | |26152|Ass|Nor|2004-01-15|Apache 1.3.29 and below directory traversal vulner| |26790|New|Maj|2004-02-09|error deleting old cache file | |29257|Opn|Nor|2004-05-27|Problem with apache-1.3.31 and mod_frontpage (dso,| |29498|New|Maj|2004-06-10|non-anonymous ftp broken in mod_proxy | |29538|Ass|Enh|2004-06-12|No facility used in ErrorLog to syslog| |30207|New|Nor|2004-07-20|Piped logs don't close read end of pipe | |30877|New|Nor|2004-08-26|htpasswd clears passwd file on Sun when /var/tmp i| |30909|New|Cri|2004-08-28|sporadic segfault resulting in broken connections | |31975|New|Nor|2004-10-29|httpd-1.3.33: buffer overflow in htpasswd if calle| |32078|New|Enh|2004-11-05|clean up some compiler warnings | |32539|New|Trv|2004-12-06|[PATCH] configure --enable-shared= brocken on SuSE| |32974|Inf|Maj|2005-01-06|Client IP not set | |33086|New|Nor|2005-01-13|unconsistency betwen 404 displayed path and server| |33495|Inf|Cri|2005-02-10|Apache crashes with WSADuplicateSocket failed for| |33772|New|Nor|2005-02-28|inconsistency in manual and error reporting by sue| |33875|New|Enh|2005-03-07|Apache processes consuming CPU| |34108|New|Nor|2005-03-21|mod_negotiation changes mtime to mtime of Document| |34114|New|Nor|2005-03-21|Apache could interleave log entries when writing t| |34404|Inf|Blk|2005-04-11|RewriteMap prg can not handle fpout | |34571|Inf|Maj|2005-04-22|Apache 1.3.33 stops logging vhost| |34573|Inf|Maj|2005-04-22|.htaccess not working / mod_auth_mysql| |35424|New|Nor|2005-06-20|httpd disconnect in Timeout on CGI| |35439|New|Nor|2005-06-21|Problem with remove /../ in util.c and mod_rewri| |35547|Inf|Maj|2005-06-29|Problems with libapreq 1.2 and Apache::Cookie | |3|New|Nor|2005-06-30|Can't find DBM on Debian Sarge| |36375|Opn|Nor|2005-08-26|Cannot include http_config.h from C++ file| |37166|New|Nor|2005-10-19|Under certain conditions, mod_cgi delivers an empt| |37252|New|Reg|2005-10-26|gen_test_char reject NLS string | |38989|New|Nor|2006-03-15|restart + piped logs stalls httpd for 24 minutes (| |39104|New|Enh|2006-03-25|[FR] fix build with -Wl,--as-needed | |39287|New|Nor|2006-04-12|Incorrect If-Modified-Since validation (due to syn| |39937|New|Nor|2006-06-30|Garbage output if README.html is gzipped or compre| |40224|Ver|Nor|2006-08-10|System time crashes Apache @year 2038 (win32 only?| |41279|New|Nor|2007-01-02|Apache 1.3.37 htpasswd is vulnerable to buffer ove| |42355|New|Maj|2007-05-08|Apache 1.3 permits non-rfc HTTP error code = 600 | |43626|New|Maj|2007-10-15|r-path_info returning invalid value | |44768|New|Blk|2008-04-07|Server suddenly reverted to showing test page only| |44926|New|Nor|2008-05-02|1.3.41 binary downloads are faulty MSIs |