Re: Capturing a Subrequest

2004-10-08 Thread Cliff Woolley
On Fri, 8 Oct 2004, Paul Querna wrote:

> So, I think something about my manually adding my output filter
> to the subrequest is wrong:

Ya, that doesn't look right.  There a function that's called (or at least
used to be called ;) "ap_add_output_filter()".  That's probably what you
want.

--Cliff


Capturing a Subrequest

2004-10-08 Thread Paul Querna
I am trying to capture the content of a sub request that I create in my 
module (mod_transform) to a bucket brigade. I want to do this so libxml2 
can use it as an input buffer.  As an example, this would allow 
mod_transform to XInclude content from another Handler (PHP, mod_perl, 
or my own module...).

I looked through the mail archives & google, and couldn't find anyone 
else that has done this.

Some people tried doing it with mod_perl more than a year ago, but ended 
 up fetching it over HTTP via LWP, not capturing the output of a sub 
request.

I cannot seem to get my output filter ran by Apache.  I tried tracing 
through it with GDB, but it is being quite stubborn on my sparc tonight.

My output filter looks like:
static apr_status_t
apachefs_filter(ap_filter_t * f, apr_bucket_brigade * bb)
{
apr_status_t rv;
apr_bucket_brigade *data = f->ctx;
rv = ap_save_brigade(f, &data, &bb, f->r->pool);
f->ctx = data;
return rv;
}
However, my capturing output filter doesn't seem to ever be called.
So, I think something about my manually adding my output filter
to the subrequest is wrong:
ap_filter_t cf;

cf.frec = ap_get_output_filter_handle(APACHEFS_FILTER_NAME);
cf.next = NULL;
cf.ctx = input_ctx->bb;
cf.r = f->r;
cf.c = f->c;

rr = ap_sub_req_lookup_uri(URI, f->r, &cf);

rr_status = ap_run_sub_req(rr);
If I pass NULL as the 3rd arg to ap_sub_req_lookup_uri(...) it will use 
my current request's filters.  I don't want the content sent to the 
client, I just want it buffered to a bucket brigade.

Is there a better way to do this?
-Paul Querna


Re: mod_disk_cache directives naming convention

2004-10-08 Thread Andreas Steinmetz
htcacheclean, take two:
Code cleanups, more apr style coding, presumably feature complete, now
built against apache 2.1 cvs. Needs further testing and especially
niceness tuning. See code below. Comments welcome.
--
Andreas Steinmetz   SPAMmers use [EMAIL PROTECTED]
/* Copyright 2001-2004 The Apache Software Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * htcacheclean.c: simple program for cleaning of
 * the disk cache of the Apache HTTP server
 *
 * Contributed by Andreas Steinmetz <[EMAIL PROTECTED]>
 * 8 Oct 2004
 */
#include "apr.h"
#include "apr_lib.h"
#include "apr_strings.h"
#include "apr_file_io.h"
#include "apr_file_info.h"
#include "apr_pools.h"
#include "apr_hash.h"
#include "apr_thread_proc.h"
#include "apr_signal.h"
#include "apr_getopt.h"
#include "apr_ring.h"
#define DEBUG
/* mod_disk_cache.c extract start */
#define DISK_FORMAT_VERSION 0
typedef struct {
/* Indicates the format of the header struct stored on-disk. */
int format;
/* The HTTP status code returned for this response.  */
int status;
/* The size of the entity name that follows. */
apr_size_t name_len;
/* The number of times we've cached this entity. */
apr_size_t entity_version;
/* Miscellaneous time values. */
apr_time_t date;
apr_time_t expire;
apr_time_t request_time;
apr_time_t response_time;
} disk_cache_info_t;
/* mod_disk_cache.c extract end */
/* mod_disk_cache.c related definitions start */
#define TEMPFILE"aptmp"
#define HEADEREXT   ".header"
#define DATAEXT ".data"
/* mod_disk_cache.c related definitions end */
#define NICE_DELAY  10
#define DELETE_NICE 250
#define HEADER  1
#define DATA2
#define TEMP4
#define HEADERDATA  (HEADER|DATA)
#define DIRINFO (APR_FINFO_MTIME|APR_FINFO_SIZE|APR_FINFO_TYPE|APR_FINFO_NAME)
typedef struct
{
char *basename;
int type;
apr_time_t htime;
apr_time_t dtime;
apr_off_t hsize;
apr_off_t dsize;
} DIRENTRY;
typedef struct _entry
{
APR_RING_ENTRY(_entry) link;
apr_time_t expire;
apr_time_t response_time;
apr_time_t htime;
apr_time_t dtime;
apr_off_t hsize;
apr_off_t dsize;
char basename[0];
} ENTRY;
static int delcount;
static int interrupted;
static int realclean;
static int verbose;
static int benice;
static apr_time_t now;
static apr_file_t *errfile;
static APR_RING_ENTRY(_entry) root;
/*
 * called on SIGINT or SIGTERM
 */
void setterm(int unused)
{
#ifdef DEBUG
apr_file_printf(errfile, "interrupt\n");
#endif
interrupted = 1;
}
/*
 * printpurge statistics
 */
static void printstats(apr_off_t total, apr_off_t sum, apr_off_t max)
{
if (!verbose)
return;
apr_file_printf(errfile,
"Statistics: total was %dK, total now %dK, limit %dK\n",
(int)(total/1024), (int)(sum/1024), (int)(max/1024));
}
/*
 * delete a single file
 */
static void delete_file(char *path, char *basename, apr_pool_t *p)
{
char *nextpath;
nextpath = apr_pstrcat(p, path, "/", basename, NULL);
#ifndef DEBUG
apr_file_remove(nextpath, p);
#else
apr_file_printf(errfile, "would delete %s\n", nextpath);
#endif
if (benice) {
if(++delcount >= DELETE_NICE) {
apr_sleep(NICE_DELAY);
delcount = 0;
}
}
}
/*
 * delete cache file set
 */
static void delete_entry(char *path, char *basename, apr_pool_t *p)
{
char *nextpath;
nextpath = apr_pstrcat(p, path, "/", basename, HEADEREXT, NULL);
#ifndef DEBUG
apr_file_remove(nextpath, p);
#else
apr_file_printf(errfile, "would delete %s\n", nextpath);
#endif
nextpath = apr_pstrcat(p, path, "/", basename, DATAEXT, NULL);
#ifndef DEBUG
apr_file_remove(nextpath, p);
#else
apr_file_printf(errfile, "would delete %s\n", nextpath);
#endif
if (benice) {
delcount += 2;
if(delcount >= DELETE_NICE) {
apr_sleep(NICE_DELAY);
delcount = 0;
}
}
}
/*
 * walk the cache directory tree
 */
static int process_dir(char *path, int baselen, apr_pool_t *pool)
{
apr_dir_t *dir;
apr_pool_t *p;
apr_hash_t *h;
apr_hash_index_t *i;
apr_file_t *fd;
apr_finfo_t info;
apr_size_t len;
char *nextpath;
char *ext;
DIRENTRY *d;
ENTRY *e;
int skip;
disk_cache_info_t disk_info;
if (apr_dir_open(&dir, path, pool) != APR_SUCCESS)
return 1;
apr_pool_create(&p, pool);
h = apr_hash_make(p);
fd = NULL;
ski

Re: [PATCH] WIN64: httpd API changes

2004-10-08 Thread Allan Edwards
Joe Orton wrote:
The ap_r* changes are not safe: these functions return negative values
on error.  Each and every int->size_t conversion needs to be carefully
checked for this kind of issue.
Good point. I will review closely this weekend.
Thanks, Allan


Re: mod_status idea

2004-10-08 Thread Brian Akins
Cliff Woolley wrote:
 "optional" part is that the module
that /defines/ the hook (and calls it) might not actually be present
itself, so modules that wish to participate in that hook should not be
broken by that other module's absense.

Okay.
So, I would something like this in a "caller":
static APR_OPTIONAL_FN_TYPE(ap_register_status_state) *register_state = 
NULL;
static APR_OPTIONAL_FN_TYPE(ap_status_state_set) *set_state = NULL;

static int foo_state;
in post_config:
register_state = APR_RETRIEVE_OPTIONAL_FN(ap_register_status_state);
set_state = APR_RETRIEVE_OPTIONAL_FN(ap_status_state_set);
if(register_state ) {
foo_state = register_state("Doing foo");
}
then in my handler or filter:
if(set_state) {
set_state(foo_state);
}
Or something similar?
--
Brian Akins
Lead Systems Engineer
CNN Internet Technologies


Re: Bye bye welcome page

2004-10-08 Thread Manoj Kasichainula
On Wed, Oct 06, 2004 at 01:12:33PM -0400, Joshua Slive wrote:
My opinion is that the shorter message is better because, by the fact 
that it gives no information at all, it is less likely to be 
misinterpreted to mean something that the website owner doesn't intend.
+1, as long as there's no mention of Apache anywhere on the page


Re: mod_disk_cache directives naming convention

2004-10-08 Thread Andreas Steinmetz
Justin Erenkrantz wrote:
Feel free to submit a patch that efficiently allows the constraint of 
the cache size.  I just don't see a way to do that as mod_disk_cache 
does not have any indexing.

IMHO, instead of making a false promise, we should remove it.  If we 
were to add such a feature later, we can add such directives 
accordingly.  -- justin
After looking at the code and thinking about the performance hits involved
I do believe Justin is right. Therefore I created a little "htcacheclean"
utility that does the the job of cache cleaning outside of apache itself.
The utility is right now not complete and intended to be a base for further
discussion. Please see below for the code (based on 2.0.52).
--
Andreas Steinmetz   SPAMmers use [EMAIL PROTECTED]
/* Copyright 2001-2004 The Apache Software Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * htcacheclean.c: simple program for cleaning of
 * the disk cache of the Apache HTTP server
 *
 * Contributed by Andreas Steinmetz <[EMAIL PROTECTED]>
 * 8 Oct 2004
 */
#include "apr.h"
#include "apr_lib.h"
#include "apr_strings.h"
#include "apr_file_io.h"
#include "apr_file_info.h"
#include "apr_pools.h"
#include "apr_hash.h"
#define DEBUG
/* mod_disk_cache.c extract start */
#define DISK_FORMAT_VERSION 0
typedef struct {
/* Indicates the format of the header struct stored on-disk. */
int format;
/* The HTTP status code returned for this response.  */
int status;
/* The size of the entity name that follows. */
apr_size_t name_len;
/* The number of times we've cached this entity. */
apr_size_t entity_version;
/* Miscellaneous time values. */
apr_time_t date;
apr_time_t expire;
apr_time_t request_time;
apr_time_t response_time;
} disk_cache_info_t;
/* mod_disk_cache.c extract end */
#define DIRINFO (APR_FINFO_MTIME|APR_FINFO_SIZE|APR_FINFO_TYPE|APR_FINFO_NAME)
#define HEADER 1
#define DATA 2
#define TEMP 4
#define HEADERDATA (HEADER|DATA)
typedef struct
{
char *basename;
int type;
apr_time_t htime;
apr_time_t dtime;
apr_off_t hsize;
apr_off_t dsize;
} DIRENTRY;
typedef struct _entry
{
struct _entry *next;
apr_time_t expire;
apr_time_t response_time;
apr_time_t htime;
apr_time_t dtime;
apr_off_t hsize;
apr_off_t dsize;
char basename[0];
} ENTRY;
static int realclean;
static int verbose;
static ENTRY *anchor;
static apr_time_t now;
apr_file_t *errfile;
static void delete_file(char *path, char *basename, apr_pool_t *p)
{
char *nextpath;
nextpath = apr_pstrcat(p, path, "/", basename, NULL);
#ifndef DEBUG
apr_file_remove(nextpath, p);
#else
apr_file_printf(errfile, "would delete %s\n", nextpath);
#endif
}
static void delete_entry(char *path, char *basename, apr_pool_t *p)
{
char *nextpath;
nextpath = apr_pstrcat(p, path, "/", basename, ".header", NULL);
#ifndef DEBUG
apr_file_remove(nextpath, p);
#else
apr_file_printf(errfile, "would delete %s\n", nextpath);
#endif
nextpath = apr_pstrcat(p, path, "/", basename, ".data", NULL);
#ifndef DEBUG
apr_file_remove(nextpath, p);
#else
apr_file_printf(errfile, "would delete %s\n", nextpath);
#endif
}
static int process_dir(char *path, int baselen, apr_pool_t *pool)
{
apr_dir_t *dir;
apr_pool_t *p;
apr_hash_t *h;
apr_hash_index_t *i;
apr_file_t *fd;
apr_finfo_t info;
apr_size_t len;
char *nextpath;
char *ext;
DIRENTRY *d;
ENTRY *e;
int skip;
disk_cache_info_t disk_info;
if (apr_dir_open(&dir, path, pool) != APR_SUCCESS)
return 1;
apr_pool_create(&p, pool);
h = apr_hash_make(p);
fd = NULL;
skip = baselen;
if (path[baselen])
skip++;
while (apr_dir_read(&info, DIRINFO, dir) == APR_SUCCESS) {
if (info.filetype == APR_DIR) {
if (info.name[0] == '.')
continue;
nextpath = apr_pstrcat(p, path, "/", info.name, NULL);
if (process_dir(nextpath, baselen, pool))
return 1;
continue;
}
if (info.filetype != APR_REG)
continue;
ext = strrchr(info.name, '.');
if (!ext) {
if (!strncasecmp(info.name, "aptmp", 5)) {
d = apr_pcalloc(p, sizeof(DIRENTRY));
d->basename = apr_pstrcat(p, path + skip, "/", info.name, NULL);
d->type = TEMP;
apr_hash_set(h, nextpath + skip, APR

Re: mod_deflate.c problems

2004-10-08 Thread Justin Erenkrantz
--On Friday, October 8, 2004 3:59 PM +0100 Joe Orton <[EMAIL PROTECTED]> wrote:
zutil.h isn't really needed at all; in fact whole the gzip header could
be in an immortal bucket, much less overhead than jumping through the
psprintf code.  Try this?
I think we tried to hard-code OS_CODE to 0x03 initially and ran into some type 
of portability problem.  That's why we were trying to set it 'correctly.' 
Either way, it could still be an immortal bucket - that part of your change is 
probably goodness.

Jean-Frederic's problem just appears to be a warning because his install is 
corrupt somehow.  It looks like he has conflicting zlib installations - so I'd 
also expect the linker to get confused as well.  -- justin


Re: Bug: Apache hangs if script invokes fork/waitpid

2004-10-08 Thread Jeff Trawick
On Thu, 07 Oct 2004 12:53:47 -0700, Paul Querna <[EMAIL PROTECTED]> wrote:
> Jeff Trawick wrote:
> > I think there needs to be a mod_fork which provides a more general
> > purpose daemon than that used by mod_cgid, and some Apache API will
> > know whether or not to send a request over there.  This preserves the
> > goal of having fork() called only by single-threaded processes so that
> > all manner of pain is avoided.
> 
> Big +1 from me in concept.
> 
> I am not sure how to do the implementation best.  mod_cgid doesn't
> really 'fork' in the sense most programs do, its mostly just starting up
> a cgi process -- from an executable on the file system.
> 
> This seems drastically different from the requirements of a generic fork().
> 
> Any thoughts on how you would want to implement this in a generic manner
> for any call from anywhere for any module?

it has to be extremely restricted; the obvious capability is to allow
apr_proc_create() to be called, with pipes set up properly back to
code running in the Apache thread; another possible service is to
allow a new child to be created and then in that process call some
specified function which was copied into the mod_fork daemon process
at apache startup; maybe that code happens to be some part of mod_perl
which can implement suitable services on behalf of a perl script

I suspect that whatever restrictions on applications are necessary to
implement such a service are the same restrictions which must be
respected anyway in order to have an application which works
reliably+portably in a threaded MPM.


Re: Apache1 and own ErrorLog-Handler?

2004-10-08 Thread Jeff Trawick
On Fri, 8 Oct 2004 12:07:45 +0200, Timo Eckert <[EMAIL PROTECTED]> wrote:
> On Fri, 8 Oct 2004 05:46:29 -0400
> Jeff Trawick <[EMAIL PROTECTED]> wrote:
> 
> > > is it possible on Apache1 to "pipe" the Error-Logs to an own
> > > handler?
> >
> > no; unlike Apache 2, Apache 1.3 has no such capability
> 
> Ok,
> 
> where have i to search in the source, that ErrorLog-Filenames
> will be parsed through strftime(); ?

the log record is actually written somewhere in src/main/http_log.c;
the function is called log_error_core()

that code would need to be modified if you wanted to add a new type of
action to take with the final log message


Re: mod_status idea

2004-10-08 Thread Cliff Woolley
On Fri, 8 Oct 2004, Eli Marmor wrote:

> Please check, before adding dependencies on internal data of
> mod_status, if APR_OPTIONAL_HOOK can help here;
> mod_status.c defines a status_hook, and maybe it can be used to help.

Actually, we would want in this case would be an optional function, not an
optional hook.  It's a small distinction, but important: an optional
function is a function that can be called when needed, if present, by a
single caller at a time.  An optional hook is a type of hook, rather than
a single function call: it is a place in the API where a callback can
occur, and multiple modules can register to participate in that hook in a
certain loosely-specified order.  The "optional" part is that the module
that /defines/ the hook (and calls it) might not actually be present
itself, so modules that wish to participate in that hook should not be
broken by that other module's absense.

In other words:
callers   callees
optional hook ONE  MANY
optional function MANY  ONE


I do like the idea in general by the way.

Hope this helps,
Cliff


Re: mod_deflate.c problems

2004-10-08 Thread Joe Orton
On Fri, Oct 08, 2004 at 03:34:18PM +0200, jean-frederic clere wrote:
> I have the following problem with mod_deflate:
>
> +++
> In file included from /usr/include/zutil.h:16,
>  from mod_deflate.c:50:
> /usr/include/zlib.h:40: warning: `ZLIB_VERSION' redefined
> /opt/SMAWPlus/include/zlib.h:40: warning: this is the location of the 
> previous definition
> In file included from /usr/include/zlib.h:34,
>  from /usr/include/zutil.h:16,
>  from mod_deflate.c:50:

zutil.h isn't really needed at all; in fact whole the gzip header could
be in an immortal bucket, much less overhead than jumping through the
psprintf code.  Try this?

Index: filters/mod_deflate.c
===
RCS file: /home/cvs/httpd-2.0/modules/filters/mod_deflate.c,v
retrieving revision 1.57
diff -u -r1.57 mod_deflate.c
--- filters/mod_deflate.c   23 Jul 2004 12:40:49 -  1.57
+++ filters/mod_deflate.c   8 Oct 2004 14:56:56 -
@@ -46,52 +46,6 @@
 
 #include "zlib.h"
 
-#ifdef HAVE_ZUTIL_H
-#include "zutil.h"
-#else
-/* As part of the encoding process, we must send what our OS_CODE is
- * (or so it seems based on what I can tell of how gzip encoding works).
- *
- * zutil.h is not always included with zlib distributions (it is a private
- * header), so this is straight from zlib 1.1.3's zutil.h.
- */
-#ifdef OS2
-#define OS_CODE  0x06
-#endif
-
-#ifdef WIN32 /* Window 95 & Windows NT */
-#define OS_CODE  0x0b
-#endif
-
-#if defined(VAXC) || defined(VMS)
-#define OS_CODE  0x02
-#endif
-
-#ifdef AMIGA
-#define OS_CODE  0x01
-#endif
-
-#if defined(ATARI) || defined(atarist)
-#define OS_CODE  0x05
-#endif
-
-#if defined(MACOS) || defined(TARGET_OS_MAC)
-#define OS_CODE  0x07
-#endif
-
-#ifdef __50SERIES /* Prime/PRIMOS */
-#define OS_CODE  0x0F
-#endif
-
-#ifdef TOPS20
-#define OS_CODE  0x0a
-#endif
-
-#ifndef OS_CODE
-#define OS_CODE  0x03  /* assume Unix */
-#endif
-#endif
-
 static const char deflateFilterName[] = "DEFLATE";
 module AP_MODULE_DECLARE_DATA deflate_module;
 
@@ -106,6 +60,21 @@
 char *note_output_name;
 } deflate_filter_config;
 
+/* RFC 1952 Section 2.3 dictates the gzip header:
+ *
+ * +---+---+---+---+---+---+---+---+---+---+
+ * |ID1|ID2|CM |FLG| MTIME |XFL|OS |
+ * +---+---+---+---+---+---+---+---+---+---+
+ */
+static const char gzip_header[10] = 
+{ '\037', '\213', Z_DEFLATED, 0,
+  0, 0, 0, 0, /* mtime */
+  0, 0x03 /* Unix OS_CODE */
+};
+
+/* magic header */
+static const char deflate_magic[2] = { '\037', '\213' };
+
 /* windowsize is negative to suppress Zlib header */
 #define DEFAULT_COMPRESSION Z_DEFAULT_COMPRESSION
 #define DEFAULT_WINDOWSIZE -15
@@ -236,9 +205,6 @@
 return NULL;
 }
 
-/* magic header */
-static char deflate_magic[2] = { '\037', '\213' };
-
 typedef struct deflate_ctx_t
 {
 z_stream stream;
@@ -269,7 +235,7 @@
  * we're in better shape.
  */
 if (!ctx) {
-char *buf, *token;
+char *token;
 const char *encoding;
 
 /* only work on main request/no subrequests */
@@ -419,22 +385,9 @@
 return ap_pass_brigade(f->next, bb);
 }
 
-/* RFC 1952 Section 2.3 dictates the gzip header:
- *
- * +---+---+---+---+---+---+---+---+---+---+
- * |ID1|ID2|CM |FLG| MTIME |XFL|OS |
- * +---+---+---+---+---+---+---+---+---+---+
- *
- * If we wish to populate in MTIME (as hinted in RFC 1952), do:
- * putLong(date_array, apr_time_now() / APR_USEC_PER_SEC);
- * where date_array is a char[4] and then print date_array in the
- * MTIME position.  WARNING: ENDIANNESS ISSUE HERE.
- */
-buf = apr_psprintf(r->pool, "%c%c%c%c%c%c%c%c%c%c", deflate_magic[0],
-   deflate_magic[1], Z_DEFLATED, 0 /* flags */,
-   0, 0, 0, 0 /* 4 chars for mtime */,
-   0 /* xflags */, OS_CODE);
-e = apr_bucket_pool_create(buf, 10, r->pool, f->c->bucket_alloc);
+/* add immortal gzip header */
+e = apr_bucket_immortal_create(gzip_header, sizeof gzip_header,
+   f->c->bucket_alloc);
 APR_BRIGADE_INSERT_TAIL(ctx->bb, e);
 
 /* If the entire Content-Encoding is "identity", we can replace it. */


Re: mod_status idea

2004-10-08 Thread Eli Marmor
Nice idea.

Please check, before adding dependencies on internal data of
mod_status, if APR_OPTIONAL_HOOK can help here;
mod_status.c defines a status_hook, and maybe it can be used to help.

Brian Akins wrote:
> 
> I think this has been proposed before, but I wanted to see if there was
> interest before I started coding.
> 
> Currently, there is a static list of "states" that mod_status can
> report.  What if we extended this so modules could add there own state.
>   Perhaps use something similar to calls to "ap_get_request_note"?
> 
> Pseudo code:
> 
> mod_foo has the foo state:
> 
> in it's post_config:
> 
> int foo_state;
> 
> foo_state = ap_register_state("Doing foo");
> 
> then in it's handler (or filter, or wherever):
> 
> ap_set_state(foo_state).
> 
> Then mod_status would have an array (or hash) of int's to strings and
> report them:
> 
> 5494 in state: "Doing foo"
> 
> The catch is we expect there to be a one character state.
> 
> This would allow a module to have multiple states (like a handler and a
> filter).  This would also make the state registration/setting voluntary.
> 
> Thoughts?

-- 
Eli Marmor
[EMAIL PROTECTED]
CTO, Founder
Netmask (El-Mar) Internet Technologies Ltd.
__
Tel.:   +972-9-766-1020  8 Yad-Harutzim St.
Fax.:   +972-9-766-1314  P.O.B. 7004
Mobile: +972-50-23-7338  Kfar-Saba 44641, Israel


mod_status idea

2004-10-08 Thread Brian Akins
I think this has been proposed before, but I wanted to see if there was 
interest before I started coding.

Currently, there is a static list of "states" that mod_status can 
report.  What if we extended this so modules could add there own state. 
 Perhaps use something similar to calls to "ap_get_request_note"?

Pseudo code:
mod_foo has the foo state:
in it's post_config:
int foo_state;
foo_state = ap_register_state("Doing foo");
then in it's handler (or filter, or wherever):
ap_set_state(foo_state).
Then mod_status would have an array (or hash) of int's to strings and 
report them:

5494 in state: "Doing foo"
The catch is we expect there to be a one character state.
This would allow a module to have multiple states (like a handler and a 
filter).  This would also make the state registration/setting voluntary.

Thoughts?
--
Brian Akins
Lead Systems Engineer
CNN Internet Technologies


mod_deflate.c problems

2004-10-08 Thread jean-frederic clere
Hi,
I have the following problem with mod_deflate:
+++
In file included from /usr/include/zutil.h:16,
 from mod_deflate.c:50:
/usr/include/zlib.h:40: warning: `ZLIB_VERSION' redefined
/opt/SMAWPlus/include/zlib.h:40: warning: this is the location of the previous 
definition
In file included from /usr/include/zlib.h:34,
 from /usr/include/zutil.h:16,
 from mod_deflate.c:50:
+++

Does it make sense to add a test to make sure zutil.h will not conflict with the 
 libz we want to use to build mod_deflate.c?

Cheers
Jean-Frederic


Re: Apache1 and own ErrorLog-Handler?

2004-10-08 Thread Timo Eckert
On Fri, 8 Oct 2004 05:46:29 -0400
Jeff Trawick <[EMAIL PROTECTED]> wrote:

> > is it possible on Apache1 to "pipe" the Error-Logs to an own
> > handler?
> 
> no; unlike Apache 2, Apache 1.3 has no such capability

Ok,

where have i to search in the source, that ErrorLog-Filenames
will be parsed through strftime(); ?

Regards,
Timo.


Re: Apache1 and own ErrorLog-Handler?

2004-10-08 Thread Jeff Trawick
On Fri, 8 Oct 2004 11:30:46 +0200, Timo Eckert <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> is it possible on Apache1 to "pipe" the Error-Logs to an own handler?

no; unlike Apache 2, Apache 1.3 has no such capability


Apache1 and own ErrorLog-Handler?

2004-10-08 Thread Timo Eckert
Hello,

is it possible on Apache1 to "pipe" the Error-Logs to an own handler?
Not to an external Programm. I'm writing an one Log-Module, and I
also want, if its possible, to handle the ErrorLogs.

Regards,
Timo.