> Here are fresh patches against trunk.
I've gone ahead and committed them.
> 4.src/apache-2/mod_rivet.c
> Changed a bit Rivet_ParseFileArgString a bit, it fixed
segfaults, but
> still needs some work.
> I've added apr_pool_t pointer to parameters we are
passing to function.
> I think we should go away from malloc/calloc usage to
apr_*
> equivalents, (It is a subject to discuss).
Most of the code in the apache 2 mod_rivet.c file is from
Eckhard
Lehmann <ecky.l gmx.de>, who did the initial work and
then abandoned
it. You should not consider it as something that must be
there, or
must work the way it does. You are indeed correct that
where possible
you should use either the apr_* functions, or the Tcl
functions (be
careful of mixing the two). His code, truth be told, looks
kind of
messy - you should investigate what things apr_* gives you,
as well as
consider using anything from this that helps out:
http://httpd.apache.or
g/apreq/
Things like this:
/*
* Rivet_IsRivetFile(char*)
*
* small helper function to get the file type. Returns 1 if
* the file ends with .rvt, 0 otherwise.
*/
static int
Rivet_IsRivetFile (char *filepath)
{
char *fileCopy = (char*) malloc((strlen(filepath)+1) *
sizeof(char));
char *cPtr;
strcpy (fileCopy, filepath);
cPtr = fileCopy + (strlen(fileCopy) - 3);
if (*(cPtr-1) != '.') {
char *ePtr = fileCopy + (strlen(fileCopy) - 1);
while (*ePtr-- != '?')
;
ePtr++;
*ePtr = ' ';
cPtr = ePtr - 3;
}
if (strcmp (cPtr, "rvt") == 0) {
return RIVET_FILE;
}
else if (strcmp (cPtr, "tcl") == 0) {
return TCL_FILE;
}
return 0;
}
Just look a bit dodgy to me. In Rivet for Apache 1.3, these
things
are handled by Apache, as they should be:
AddType application/x-httpd-rivet .rvt
AddType application/x-rivet-tcl .tcl
Of course, maybe I'm missing something, but... I'm just
saying - feel
*very* free to improve things as you see fit!
> Module successfully builds on OpenBSD and Debian for
me, it is able
> to puts "<b>Hello World<b>" ,
still there's a lot of work left.
Cool!
--
David N. Welton
http://www.welton.it/dav
idw/
------------------------------------------------------------
---------
To unsubscribe, e-mail: rivet-dev-unsubscribe tcl.apache.org
For additional commands, e-mail: rivet-dev-help tcl.apache.org
|