Re: TEST TARBALLS UP

2002-06-14 Thread Cliff Woolley

On Sat, 15 Jun 2002, Cliff Woolley wrote:

> I just did a test-roll (non-numbered) since we've made some big Makefile

PS: they're in the usual location: http://httpd.apache.org/dev/dist/

--Cliff




TEST TARBALLS UP

2002-06-14 Thread Cliff Woolley


I just did a test-roll (non-numbered) since we've made some big Makefile
changes this evening.  Do me a favor and make sure they compile and
install correctly on your favorite platform, the more obscure the better.
;)

--Cliff




makefile question (was Re: tarballs are up for testing)

2002-06-14 Thread Cliff Woolley

On Sat, 15 Jun 2002, Cliff Woolley wrote:

> On Wed, 12 Jun 2002, jean-frederic clere wrote:
>
> > I have noted the following on ReliantUnix:
> > +++
> > Installing configuration files
> > Installing HTML documents
> > Usage: rm [-firR] file ...
> > make[1]: *** [install-htdocs] Error 2
> > make[1]: Leaving directory `/home1/apache20/httpd-2.0.37'
> > make: *** [install-recursive] Error 1
> > +++
> > The fix is easy. Find it attached.
>
> Committed, thanks!

I just noticed that the '- ' prefix isn't being used anywhere else in our
Makefiles.  Are we sure it's portable?

--Cliff




Re: tarballs are up for testing

2002-06-14 Thread Cliff Woolley

On Wed, 12 Jun 2002, jean-frederic clere wrote:

> I have noted the following on ReliantUnix:
> +++
> Installing configuration files
> Installing HTML documents
> Usage: rm [-firR] file ...
> make[1]: *** [install-htdocs] Error 2
> make[1]: Leaving directory `/home1/apache20/httpd-2.0.37'
> make: *** [install-recursive] Error 1
> +++
> The fix is easy. Find it attached.

Committed, thanks!

--Cliff




Re: cvs commit: httpd-2.0/server core.c

2002-06-14 Thread rbb

On 15 Jun 2002 [EMAIL PROTECTED] wrote:

> rbb 2002/06/14 22:49:06
> 
>   Modified:.CHANGES
>server   core.c
>   Log:
>   Make the default_handler catch all requests that aren't served by
>   another handler.  This also gets us to return a 404 if a directory
>   is requested, there is no DirectoryIndex, and mod_autoindex isn't
>   loaded.
>   
>   PR: 8045
>   Submitted by:   Justin Erenkrantz

Just to clarify.  There was a comment in PR 8045 that returning 500 was
better than 404 if a directory exists, but there is no index.  I
completely disagree.  Users see a 500, and they get scared.  IMO, a 404
means that we could not find a valid response, which is this case
exactly.  Plus, this matches what we did in 1.3, and users expect it.

Ryan

___
Ryan Bloom  [EMAIL PROTECTED]
550 Jean St
Oakland CA 94610
---




RE: questions from my trivial patch

2002-06-14 Thread Ryan Bloom

> From: Brian Degenhardt [mailto:[EMAIL PROTECTED]]
> 
> The functions for ap_hook_open_logs, ap_hook_post_config, and
> ap_hook_pre_config will fail if DECLINE is returned.  Is that
> intentional?

Yes.  This is because those are configuration phases.  If a module tries
to do something in those phases and can't, then the server should not
continue to run, because something wasn't configured properly.  If the
server did continue, then it would most likely not behave the way it was
expected to.

> In the quick_handler, returning HTTP_mumble will result in that status
> being returned in a real request, but it will fallback to the real
> handler in a subrequest.  Is that intentional?

I don't know, but it sounds completely incorrect.  Bill, can you shed
any light here?

> What's the difference between adding your filters inside your
> ap_hook_insert_filter hook versus calling ap_register_*_filter right
> inside of the register_hooks callback?

You are confusing registering and adding hooks.  You should always
register the hooks in register_hooks, but adding the hook to the request
should be done during request processing.  Basically registering a
filter lets the server know that the filter exists, but it doesn't
enable it for any requests.  Adding the filter enables it for that
request.

Ryan





Re: [PATCH] Apache 1.3 and OpenBSD

2002-06-14 Thread Brad

--- Configure.orig  Fri Jun  7 15:47:58 2002
+++ Configure   Fri Jun  7 15:51:21 2002
@@ -1130,6 +1130,9 @@ if [ "x$using_shlib" = "x1" ] ; then
*)
   LD_SHLIB="gcc"
   LDFLAGS_SHLIB="-shared \$(CFLAGS_SHLIB)"
+  if [ "x`echo __ELF__ | $CC -E - | grep __ELF__`" = "x" ]; then
+LDFLAGS_SHLIB_EXPORT="-Wl,-E"
+  fi
;;
esac
LDFLAGS_MOD_SHLIB=$LDFLAGS_SHLIB

>Date: Mon, 3 Jun 2002 11:13:32 -0400
>From: Jim Jagielski <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Cc: [EMAIL PROTECTED]
>Subject: Re: [PATCH] Apache 1.3 and OpenBSD
>
>> >--- Configure.orig  Sat May 11 23:39:59 2002
>>>+++ ConfigureMon May 20 17:19:41 2002
>>>@@ -1130,6 +1130,9 @@ if [ "x$using_shlib" = "x1" ] ; then
>>> *)
>>>LD_SHLIB="gcc"
>>>LDFLAGS_SHLIB="-shared \$(CFLAGS_SHLIB)"
>>>+   if [ -z "`echo __ELF__ | $CC -E - | grep __ELF__`" ]; then
>>>+ LDFLAGS_SHLIB_EXPORT="-Wl,-E"
>> >+  fi
>
>The '-z' is not normally used in Configure but that is easily fixed... :)
>--
>===
>   Jim Jagielski   [|]   [EMAIL PROTECTED]   [|]   http://www.jaguNET.com/
>  "A society that will trade a little liberty for a little order
> will lose both and deserve neither" - T.Jefferson





questions from my trivial patch

2002-06-14 Thread Brian Degenhardt

The functions for ap_hook_open_logs, ap_hook_post_config, and
ap_hook_pre_config will fail if DECLINE is returned.  Is that
intentional?

In the quick_handler, returning HTTP_mumble will result in that status
being returned in a real request, but it will fallback to the real
handler in a subrequest.  Is that intentional?

What's the difference between adding your filters inside your
ap_hook_insert_filter hook versus calling ap_register_*_filter right
inside of the register_hooks callback?

-bmd



[PATCH] mod_example.c better comments

2002-06-14 Thread Brian Degenhardt

Some of the comments were out of order or incomplete in
mod_exmple.c.  It was also missing ap_hook_create_request()

This brings it up to date a bit.

Sorry if this is kinda trivial, I'm probably going to generate a lot
more silly fixes like this.  Let me know if there's an optimal
way/time for stuff like this.

-bmd

--- mod_example.c.old   Fri Jun 14 15:54:56 2002
+++ mod_example.c   Fri Jun 14 17:15:21 2002
@@ -657,31 +657,6 @@
 /* see the individual handler comments below for details.   */
 /*  */
 /*--*/
-/* 
- * This function is called during server initialisation.  Any information
- * that needs to be recorded must be in static cells, since there's no
- * configuration record.
- *
- * There is no return value.
- */
-
-/* 
- * This function is called when an heavy-weight process (such as a child) is
- * being run down or destroyed.  As with the child initialisation function,
- * any information that needs to be recorded must be in static cells, since
- * there's no configuration record.
- *
- * There is no return value.
- */
-
-/* 
- * This function is called during server initialisation when an heavy-weight
- * process (such as a child) is being initialised.  As with the
- * module initialisation function, any information that needs to be recorded
- * must be in static cells, since there's no configuration record.
- *
- * There is no return value.
- */
 
 /*
  * This function gets called to create a per-directory configuration
@@ -844,8 +819,14 @@
 }
 
 /*
- * This routine is called before the server processes the configuration
- * files.  There is no return value.
+ * This routine was registered by ap_hook_pre_config()
+ *
+ * It is called before the server processes the configuration files
+ * during server initialisation.  Any information that needs to be
+ * recorded must be in static cells, since there's no configuration
+ * record.
+ *
+ * The return value must be OK or apache will not start up.
  */
 static int x_pre_config(apr_pool_t *pconf, apr_pool_t *plog,
 apr_pool_t *ptemp)
@@ -859,12 +840,11 @@
 }
 
 /*
- * This routine is called to perform any module-specific fixing of header
- * fields, et cetera.  It is invoked just before any content-handler.
+ * This routine is registered by ap_hook_post_config()
+ * It is called just after the server processes the configuration
+ * files.  It is mostly analogous to old apache _init routines.
  *
- * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, the
- * server will still call any remaining modules with an handler for this
- * phase.
+ * The return value must be OK or apache will not start up.
  */
 static int x_post_config(apr_pool_t *pconf, apr_pool_t *plog,
   apr_pool_t *ptemp, server_rec *s)
@@ -877,12 +857,13 @@
 }
 
 /*
- * This routine is called to perform any module-specific fixing of header
- * fields, et cetera.  It is invoked just before any content-handler.
+ * This function is registered by ap_hook_open_logs()
+ * It is responsible for opening any logfiles. It is assumed that if
+ * you are going to fail the open_logs phase, then you will print out
+ * your own message that explains what has gone wrong.  The server
+ * doesn't need to do that for you.
  *
- * The return value is OK, DECLINED, or HTTP_mumble.  If we return OK, the
- * server will still call any remaining modules with an handler for this
- * phase.
+ * This function must return OK or apache will not start up.
  */
 static int x_open_logs(apr_pool_t *pconf, apr_pool_t *plog,
 apr_pool_t *ptemp, server_rec *s)
@@ -895,7 +876,16 @@
 }
 
 /*
- * All our process-death routine does is add its trace to the log.
+ * This is the cleanup routine registered by
+ * apr_pool_cleanup_register() which executes when when an
+ * heavy-weight process (such as a child) is being run down or
+ * destroyed.  As with the child initialisation function, any
+ * information that needs to be recorded must be in static cells,
+ * since there's no configuration record.  Note that it is not
+ * registered in x_register_hooks but inside of x_child_init. 
+ *
+ * This function should return APR_SUCCESS on success.  On error,
+ * see the apr docs for appropriate errorcodes, or use APR_EGENERAL
  */
 static apr_status_t x_child_exit(void *data)
 {
@@ -914,7 +904,13 @@
 }
 
 /*
- * All our process initialiser does is add its trace to the log.
+ * This function is registered by ap_hook_child_init()
+ * It is called during server initialisation when an heavy-weight
+ * process (such as a child) is being initialised.  As with the module
+ * initialisation function, any information that needs to be recorded
+ * must be in static cells, since there's no configuration record.
+ *
+ * Note that it registers a cleanup function
  */
 static void x_child_init(

Re: problem with mod_cache

2002-06-14 Thread Bill Stoddard

>
>
> --ian
>
> Oh.. is anyone using the new PQ code.. i'd like to know if it is working
> better than what was out there before
>
>

Jean-Jacques reports that the PQ code has introduced a seg fault. I haven't tested this
patch fully but I suspect it will fix the problem (or at least fix a problem).

Index: mod_mem_cache.c
===
RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_mem_cache.c,v
retrieving revision 1.70
diff -u -r1.70 mod_mem_cache.c
--- mod_mem_cache.c 10 Jun 2002 21:10:08 - 1.70
+++ mod_mem_cache.c 14 Jun 2002 23:26:35 -
@@ -192,28 +192,52 @@
 }
 /**
  * callback to free an entry
- * XXX: just call cleanup_cache_object ?
+ * There is way too much magic in this code. Right now, this callback
+ * is only called out of cache_insert() which is called under protection
+ * of the sconf->lock, which means that we do not (and should not)
+ * attempt to obtain the lock recursively.
+ * The cache API needs some serious cleanup work...
  */
 static void memcache_cache_free(void*a)
 {
 cache_object_t *obj = (cache_object_t *)a;
-cleanup_cache_object(obj);
+
+/* Cleanup the cache object. Object should be removed from the cache
+ * now. Increment the refcount before setting cleanup to avoid a race
+ * condition. A similar pattern is used in remove_url()
+ */
+#ifdef USE_ATOMICS
+apr_atomic_inc(&obj->refcount);
+#else
+obj->refcount++;
+#endif
+
+obj->cleanup = 1;
+
+#ifdef USE_ATOMICS
+apr_atomic_dec(&obj->refcount);
+#else
+obj->refcount--;
+#endif
+if (!obj->refcount) {
+cleanup_cache_object(obj);
+}
 }
 /*
  * functions return a 'negative' score as lower is better in a priority Q





Tagging 2.0.38

2002-06-14 Thread Cliff Woolley


 at 1300 EDT today.

--Cliff




RE: [Bug 9858] New: - ApacheMonitor can not start service due to bug in service.c or ApacheMonitor.c (fwd)

2002-06-14 Thread Mladen Turk



> -Original Message-
> From: William A. Rowe, Jr. [mailto:[EMAIL PROTECTED]] 
> Sent: 14. lipanj 2002 9:18
> To: Cliff Woolley
> Cc: [EMAIL PROTECTED]
> Subject: Re: [Bug 9858] New: - ApacheMonitor can not start 
> service due to bug in service.c or ApacheMonitor.c (fwd)
> 
> 
> This is the same bug as winnt's mpm that Jeff Trawick's -k 
> patch introduced, we used to ignore this accidental 
> non-switch 'parameter' but the parsing change showed this up as a bug.
> 
> I'll let Mladen author the patch and apply later today :-)  
> The answer is pretty trivial, we simply shouldn't have ever 
> provided an argv[0] to the StartService call.  The old 
> parsers [1.3/2.0] both overlooked this bug.
> 

Yes, now that I look that don't know why did I even done all that arg
parsing...
It works even without args :-).

If doesn't theN just  replace the line 775 with the args[0] = NULL;


MT.



Index: ApacheMonitor.c
===
RCS file: /home/cvspublic/httpd-2.0/support/win32/ApacheMonitor.c,v
retrieving revision 1.18
diff -u -3 -r1.18 ApacheMonitor.c
--- ApacheMonitor.c 19 Apr 2002 19:19:44 -  1.18
+++ ApacheMonitor.c 14 Jun 2002 07:40:46 -
@@ -667,7 +667,6 @@
 SC_HANDLE schService;
 SC_HANDLE schSCManager;
 SERVICE_STATUS schSStatus;
-LPSTR *args;
 int   ticks;
 
 if (g_dwOSVersion == OS_VERSION_WIN9X)
@@ -717,17 +716,6 @@
 }
 else
 {
-/* Apache 2.0 uses '-k runservice' as cmdline parameter */
-sPos = strstr(szImagePath, "--ntservice");
-if (!sPos)
-{
-sPos = strstr(szImagePath, "-k runservice");
-serviceFlag = FALSE;
-}
-if (sPos)
-lstrcpyn(szBuf, szImagePath, sPos - szImagePath);
-else
-return FALSE;
 schSCManager = OpenSCManager(
 szComputerName,
 NULL,
@@ -771,16 +759,8 @@
 case SERVICE_CONTROL_CONTINUE:
 sprintf(szMsg, g_lpMsg[IDS_MSG_SRVSTART-IDS_MSG_FIRST], 
szServiceName);
 addListBoxString(g_hwndStdoutList, szMsg);
-args = (char **)malloc(3 * sizeof(char*));
-args[0] = szBuf;
-if (serviceFlag)
-args[1] = "--ntservice";
-else
-{
-args[1] = "-k";
-args[2] = "runservice";
-}
-if (StartService(schService, serviceFlag ? 2 : 3, args)) 
+
+if (StartService(schService, 0, NULL)) 
 {
 Sleep(1000);
 while (QueryServiceStatus(schService, &schSStatus)) 
@@ -800,8 +780,6 @@
 addListBoxString(g_hwndStdoutList, szMsg);
 }
 }
-/* is this OK to do? */
-free(args);
 break;
 case SERVICE_APACHE_RESTART:
 sprintf(szMsg, g_lpMsg[IDS_MSG_SRVRESTART-IDS_MSG_FIRST], 
szServiceName);