Re: PR 7492

2001-12-25 Thread Don Hughes

I converted a working Apache1.3 server to Apache2.0 on a SuSE Linux system 
with IPV6 support.

All httpd.conf address references are in IPV4 format, all log/status/error messages 
show all addresses in IPV4 format.  However, I had to use IPV6 address in the 
VHosts sections or the incoming requests would not match.

VirtualHost :::10.168.xxx.yyy:8080 

This certainly was not intuitive, and took several days of fussing to discover.


...don
[EMAIL PROTECTED]




configtest

2001-12-25 Thread Don Hughes

Trying to use configtest with a httpd.conf file that has a line like:

VirtualHost 82

gives:

../apachectl: line 187: 2066 Sementation fault $HTTPD - t

...don
[EMAIL PROTECTED]




setsockopt error

2001-12-25 Thread Don Hughes

Apache2.0

If all of my vhosts are of the form:

VirtualHost *:nn

and if there is a Listen for a port (81)  that does NOT appear in a VirtualHost 
directive, then I get:

... [crit] (88)Socket operation on non-socket: make_sock: for address [::]:81, 
setsockopt: (SO_REUSEADDR)

...don
[EMAIL PROTECTED]




Re: configtest

2001-12-25 Thread Jeff Trawick

Don Hughes [EMAIL PROTECTED] writes:

 Trying to use configtest with a httpd.conf file that has a line like:
 
 VirtualHost 82
 
 gives:
 
 ../apachectl: line 187: 2066 Sementation fault $HTTPD - t

cool!  easy to reproduce, probably easy to fix...  

keep those cards and letters coming

-- 
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
   http://www.geocities.com/SiliconValley/Park/9289/
 Born in Roswell... married an alien...



Re: related config directives

2001-12-25 Thread Aaron Bannert

On Mon, Dec 24, 2001 at 09:40:03AM -0800, Ryan Bloom wrote:
 I thought of another reason to do this in the tree itself.  The point of the config
 tree is to keep the current config in memory.  If you are going to modify the
 config, you need to modify it in the tree.  By doing to work on the tree, you
 get that for free.

I'm confused (it may just be the eggnog :), but aren't we talking about
two different things? There are fatal and non-fatal errors in the config.
We want to give a meaningful message when we discover a fatal error,
but we just want to issue a warning and try to adjust something sane
for non-fatal errors. I can see how fidgeting with absurd settings by
rearranging the order in the tree will make it easier to deal with some
of the non-fatal errors, but doesn't it seem easiest to deal with the
fatal errors all at once after we've got a stable config tree with all
the defaults in place in the tree?

-aaron



Re: cvs commit: httpd-2.0/server/mpm/worker worker.c

2001-12-25 Thread Aaron Bannert

Ugh! I've been meaning to patch the prototype for apr_thread_exit for
a long time (so that it takes an apr_status_t instead of a pointer), but
it got lost in the shuffle. I'll see if I can fix this sometime this week
so we don't have to have ackward rv stuff like this.

-aaron


On Sun, Dec 23, 2001 at 01:56:49PM -, [EMAIL PROTECTED] wrote:
 dreid   01/12/23 05:56:49
 
   Modified:server/mpm/worker worker.c
   Log:
   This fixes a segfault that showed up on BeOS and may catch other systems.
   
   Revision  ChangesPath
   1.51  +4 -2  httpd-2.0/server/mpm/worker/worker.c
   
   Index: worker.c
   ===
   RCS file: /home/cvs/httpd-2.0/server/mpm/worker/worker.c,v
   retrieving revision 1.50
   retrieving revision 1.51
   diff -u -r1.50 -r1.51
   --- worker.c2001/12/19 14:49:22 1.50
   +++ worker.c2001/12/23 13:56:49 1.51
   @@ -790,7 +790,8 @@
worker_thread_count--;
apr_thread_mutex_unlock(worker_thread_count_mutex);

   -apr_thread_exit(thd, APR_SUCCESS);
   +rv = APR_SUCCESS;
   +apr_thread_exit(thd, rv);
return NULL;
}

   @@ -879,7 +880,8 @@
 *  life_status is almost right, but it's in the worker's structure, and 
 *  the name could be clearer.   gla
 */
   -apr_thread_exit(thd, APR_SUCCESS);
   +rv = APR_SUCCESS;
   +apr_thread_exit(thd, rv);
return NULL;
}

   
   
   



Re: setsockopt error

2001-12-25 Thread Aaron Bannert

On Tue, Dec 25, 2001 at 02:46:08PM -0500, Don Hughes wrote:
 Apache2.0
 
 If all of my vhosts are of the form:
 
 VirtualHost *:nn
 
 and if there is a Listen for a port (81)  that does NOT appear in a VirtualHost 
 directive, then I get:
 
 ... [crit] (88)Socket operation on non-socket: make_sock: for address [::]:81, 
 setsockopt: (SO_REUSEADDR)

How are you starting Apache? bin/apachectl?

-aaron



[PATCH] fix prep_walk_cache performance

2001-12-25 Thread Brian Pane

This change may be controversial, so I'm soliciting
comments before committing...

The prep_walk_cache() function in server/request.c
is one of the slower parts of the core server.  About
60% of its run time is due to the apr_pool_userdata_*
functions.

The attached patch eliminates the use of the apr_pool_userdata_*
functions by adding hooks for the various walk caches to the
core_request_config structure (stored in r-request_config).

--Brian




Index: include/http_core.h
===
RCS file: /home/cvs/httpd-2.0/include/http_core.h,v
retrieving revision 1.55
diff -u -r1.55 http_core.h
--- include/http_core.h 2001/12/13 14:50:36 1.55
+++ include/http_core.h 2001/12/26 06:58:26
@@ -330,10 +330,21 @@
 
 /* Per-request configuration */
 
+typedef enum {
+AP_WALK_DIRECTORY,
+AP_WALK_LOCATION,
+AP_WALK_FILE,
+AP_NUM_WALK_CACHES
+} ap_walk_cache_type;
+
 typedef struct {
 /* bucket brigade used by getline for look-ahead and 
  * ap_get_client_block for holding left-over request body */
 struct apr_bucket_brigade *bb;
+
+/* a place to hold per-request working data for
+ * ap_directory_walk, ap_location_walk, and ap_file_walk */
+void *walk_cache[AP_NUM_WALK_CACHES];
 } core_request_config;
 
 /* Per-directory configuration */
Index: server/core.c
===
RCS file: /home/cvs/httpd-2.0/server/core.c,v
retrieving revision 1.121
diff -u -r1.121 core.c
--- server/core.c   2001/12/18 13:48:52 1.121
+++ server/core.c   2001/12/26 06:58:28
@@ -3399,17 +3399,18 @@
 
 static int core_create_req(request_rec *r)
 {
+core_request_config *req_cfg;
+req_cfg = apr_palloc(r-pool, sizeof(core_request_config));
+memset(req_cfg, 0, sizeof(*req_cfg));
 if (r-main) {
-ap_set_module_config(r-request_config, core_module,
-  ap_get_module_config(r-main-request_config, core_module));
+core_request_config *main_req_cfg = (core_request_config *)
+ap_get_module_config(r-main-request_config, core_module);
+req_cfg-bb = main_req_cfg-bb;
 }
 else {
-core_request_config *req_cfg;
-
-req_cfg = apr_pcalloc(r-pool, sizeof(core_request_config));
 req_cfg-bb = apr_brigade_create(r-pool);
-ap_set_module_config(r-request_config, core_module, req_cfg);
 }
+ap_set_module_config(r-request_config, core_module, req_cfg);
 
 ap_add_input_filter(NET_TIME, NULL, r, r-connection);
 
Index: server/request.c
===
RCS file: /home/cvs/httpd-2.0/server/request.c,v
retrieving revision 1.86
diff -u -r1.86 request.c
--- server/request.c2001/12/14 03:30:23 1.86
+++ server/request.c2001/12/26 06:58:29
@@ -296,9 +296,10 @@
 apr_array_header_t *walked; /* The list of walk_walked_t results */
 } walk_cache_t;
 
-static walk_cache_t *prep_walk_cache(const char *cache_name, request_rec *r)
+static walk_cache_t *prep_walk_cache(ap_walk_cache_type t, request_rec *r)
 {
 walk_cache_t *cache;
+core_request_config *my_req_cfg;
 
 /* Find the most relevant, recent entry to work from.  That would be
  * this request (on the second call), or the parent request of a
@@ -306,25 +307,32 @@
  * this _walk()er with a copy it is allowed to munge.  If there is no
  * parent or prior cached request, then create a new walk cache.
  */
-if ((apr_pool_userdata_get((void **)cache, cache_name, r-pool)
-!= APR_SUCCESS)
-|| !cache) {
-if ((r-main  (apr_pool_userdata_get((void **)cache, 
-   cache_name,
-   r-main-pool)
- == APR_SUCCESS)  cache)
- || (r-prev  (apr_pool_userdata_get((void **)cache, 
-   cache_name,
-   r-prev-pool)
- == APR_SUCCESS)  cache)) {
-cache = apr_pmemdup(r-pool, cache, sizeof(*cache));
+my_req_cfg = (core_request_config *)
+ap_get_module_config(r-request_config, core_module);
+
+if (!my_req_cfg || !(cache = my_req_cfg-walk_cache[t])) {
+core_request_config *req_cfg;
+if ((r-main 
+ (req_cfg = (core_request_config *)
+  ap_get_module_config(r-main-request_config, core_module)) 
+ req_cfg-walk_cache[t]) ||
+(r-prev 
+ (req_cfg = (core_request_config *)
+  ap_get_module_config(r-prev-request_config, core_module)) 
+ req_cfg-walk_cache[t])) {
+cache = apr_pmemdup(r-pool, req_cfg-walk_cache[t],
+sizeof(*cache));
 cache-walked = apr_array_copy(r-pool, cache-walked);
 }
 else {
 cache = apr_pcalloc(r-pool,