You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rivet-dev@tcl.apache.org by Eckhard Lehmann <ec...@gmx.de> on 2006/01/09 17:12:44 UTC
Re: Rivet Apache 2
Hi David,
> Well - with Subversion, we can rename files and maintain version
> history, so let's just pick one and go with it. Barring something
> better, mod_rivet22.c is fine - either that or put it in an apache2.2/
> directory.
The last is a good choice, I think. I have put all the files from src/
into a new subdirectory src/apache-2, furthermore I moved the Apache1.3
source files from src/ to a new subdirectory src/apache-1. I added a new
toplevel Makefile.am in src/ and one Makefile.am in each of the both new
subdirectories.
configure.ac has some new macros now:
- APACHE -- adds support for --with-apache switch to define the apache
base directory
- APACHE_INCLUDE -- adds support for --with-apache-include, to define
the apache include directories. On some systems the include's may be not
in the standard locations.. e.g. on debian they are
in /usr/include/apache${version}.
- APR_INCLUDE -- same as above for --with-apr-include. Both macros check
the base directory that was set by APACHE.
- APACHE_VERSION -- support for the switch --apache-version, either "1"
or "2". Default setting is currently "2". sets the source directory to
apache-1 or apache-2, so that rivet is compiled for the appropriate
version.
However, I did not check whether this all works with Apache1.x...
> The auto* stuff is a "pain in the ass"...
Oh yeah :-/! I thought about a build system for Tcl extensions in Tcl
all the time. It wouldn't be that complicated - but it would be
reinventing the wheel...
> , so worry first about the C code, and the other stuff will follow.
Well, I would like to have these things finished when I send the code to
you and others, so that you/they can start to play with it immediately,
without worrying about these nasty details.
> Do, however, separate the .c code into two different files, so that
> you're not #ifdef'ing everything!
No #ifdef's, I see, we agree on that :-). That would be IMO the poorest
solution.
> In short, if you want to make sure someone else has a copy of the code,
> by all means, send it to me, but please, please discuss your work
> publically on the mailing list!
I have subscribed to the rivet-dev right now, and will summarize my work
there, as soon as the confirmation emails are done. Meanwhile, I send a
tar.gz file to you.
Could you please check it into the subversion repository, if
appropriate? I can do anonymous checkouts to see the changes from other
people...
> diff -n can handle new files. It's one of those programs that has an
> option for *everything*, although no one knows them all:-)
I will try it out :-).
> > That's what I did and will do further. I got rivet to parse .rvt files
> > and to display the content. But it is done i a slightly other way than
> > it was before...
>
> Excellent!
The only thing to do for configuration is, to extend the text/html mime
type (in $APACHE/conf/mime.types) by the .rvt extension:
...
text/html html htm rvt
...
No other configuration is necessary, the application/x-httpd-rivet
handler is also not necessary any more, for Apache2. I have not found a
way to handle this, instead I got mystic crashes, when I set the request
handler (request_rec::handler) to "application/x-httpd-rivet".
I don't know whether this is the best solution, but it can be changed
whenever we want.
Best regards,
Eckhard
Re: Rivet Apache 2
Posted by "David N. Welton" <da...@dedasys.com>.
Eckhard Lehmann wrote:
>>Ah... you are probably going to need to integrate apreq 2 (
>>http://httpd.apache.org/apreq/ ) into the apache-2 subdirectory.
>
> ...
>
>>The relevant files, at least in the 1.3 version of Rivet, are these:
>>
>>apache_multipart_buffer.c
>>apache_multipart_buffer.h
>>apache_request.c
>>apache_request.h
>>
>>I just copied them in, instead of requiring people to get and install apreq.
> What exactly is needed from apreq? Apreq seems to be a library with
> complex functionality, from which only a small subset is needed...
They are used to fetch variables, and, most importantly, handle file
uploads (which is sort of tricky). It's a convenience thing, mainly.
--
David N. Welton
- http://www.dedasys.com/davidw/
Linux, Open Source Consulting
- http://www.dedasys.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: Rivet Apache 2
Posted by Eckhard Lehmann <ec...@web.de>.
David,
Am Mittwoch, den 11.01.2006, 08:46 +0100 schrieb David N. Welton:
> Ah... you are probably going to need to integrate apreq 2 (
> http://httpd.apache.org/apreq/ ) into the apache-2 subdirectory.
...
> The relevant files, at least in the 1.3 version of Rivet, are these:
>
> apache_multipart_buffer.c
> apache_multipart_buffer.h
> apache_request.c
> apache_request.h
>
> I just copied them in, instead of requiring people to get and install apreq.
What exactly is needed from apreq? Apreq seems to be a library with
complex functionality, from which only a small subset is needed...
> 1) The apreq list. It's low traffic, the guys there are very helpful,
> and they know the C API well.
>
> 2) dev@httpd.apache.org - http://httpd.apache.org/lists.html the main
> dev list. It's pretty high traffic, but if someone knows the API, it's
> these guys. That web page also mentions a module writers list, but I
> don't know if it's active or not.
Thank you, I will have a look at them.
> By the way, did you reorganize the code to separate out the
> 'independant' files and make sure things still compile? Once you do
> that, I think there are no longer any blocks to putting this in subversion!
I did it, yes. I will send you a new tar.gz file separately tomorrow or
so. Still I don't know whether it compiles with Apache1.x..
At least automake-1.6 is needed now to build it (resp. to generate
Makefile.in's from the Makefile.am's). Automake-1.4 will not work, since
it does not support subdirectories.
>
> I guess it's also high time that we figure out how to use subversion
> branches, so that the current code can become 1_0...
>
This is described here:
http://svnbook.red-bean.com/nightly/en/svn.branchmerge.using.html#svn.branchmerge.using.create
I never did it on the command line but used tortoise-svn several times
for it...
Eckhard
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: Rivet Apache 2
Posted by "David N. Welton" <da...@dedasys.com>.
Eckhard Lehmann wrote:
>>>The only thing to do for configuration is, to extend the text/html mime
>>>type (in $APACHE/conf/mime.types) by the .rvt extension:
>>>
>>>...
>>>text/html html htm rvt
>>>...
>>I don't think that's quite right... we don't want the Rivet handler to
>>parse html files...does it try to?
> No, it does not. I have created a translate function, registered with
> ap_hook_translate_name(). It checks for the file ending - which is done
> by parsing the request_rec::args field. This seems to be the only place
> where the file (relative to the server root) is accessible as
Hrm... this is quite different from how 1.3 does things. I'm not
convinced it's right, but... let's use it for now until we figure out if
there is a better way or not.
> /file.rvt?param1=value1¶m2=value2 ...
>
> It sets the request_rec::filename member to the complete file. I let the
> handlers (Rivet_SendContent and Rivet_TranslateUri) return DECLINED, if
> the extension is not .rvt:
>
> ...
> if (!Rivet_IsRivetFile(r->filename))
> return DECLINED;
> ...
> I have a problem here: the request_rec, which is given as argument to
> the handlers, is not complete - unfortunately. All the file and uri
> related members are not set - even worse: they are not even set to NULL
> but contain garbage :-/.
Ah... you are probably going to need to integrate apreq 2 (
http://httpd.apache.org/apreq/ ) into the apache-2 subdirectory.
> This is funny and irritating to me... I think that it must be possible
> somehow, to get at a more valuable request_rec during the hook
> processing, but I did not find out how... The Apache API is very poorly
> documented :-(.
> It would be nice if someone who has more experience with the Apache2 API
> could try to fix this or point me at a way to get it "right"... Maybe
> the module itself is responsible for setting the file and uri members to
> the appropriate request_rec?
The relevant files, at least in the 1.3 version of Rivet, are these:
apache_multipart_buffer.c
apache_multipart_buffer.h
apache_request.c
apache_request.h
I just copied them in, instead of requiring people to get and install apreq.
I know the API isn't documented that well... there are a couple of other
lists that you might want to be on
1) The apreq list. It's low traffic, the guys there are very helpful,
and they know the C API well.
2) dev@httpd.apache.org - http://httpd.apache.org/lists.html the main
dev list. It's pretty high traffic, but if someone knows the API, it's
these guys. That web page also mentions a module writers list, but I
don't know if it's active or not.
By the way, did you reorganize the code to separate out the
'independant' files and make sure things still compile? Once you do
that, I think there are no longer any blocks to putting this in subversion!
I guess it's also high time that we figure out how to use subversion
branches, so that the current code can become 1_0...
--
David N. Welton
- http://www.dedasys.com/davidw/
Linux, Open Source Consulting
- http://www.dedasys.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: Rivet Apache 2
Posted by Eckhard Lehmann <ec...@gmx.de>.
Am Montag, den 09.01.2006, 23:45 +0100 schrieb David N. Welton:
> > The only thing to do for configuration is, to extend the text/html mime
> > type (in $APACHE/conf/mime.types) by the .rvt extension:
> >
> > ...
> > text/html html htm rvt
> > ...
>
> I don't think that's quite right... we don't want the Rivet handler to
> parse html files...does it try to?
No, it does not. I have created a translate function, registered with
ap_hook_translate_name(). It checks for the file ending - which is done
by parsing the request_rec::args field. This seems to be the only place
where the file (relative to the server root) is accessible as
/file.rvt?param1=value1¶m2=value2 ...
It sets the request_rec::filename member to the complete file. I let the
handlers (Rivet_SendContent and Rivet_TranslateUri) return DECLINED, if
the extension is not .rvt:
...
if (!Rivet_IsRivetFile(r->filename))
return DECLINED;
...
I have a problem here: the request_rec, which is given as argument to
the handlers, is not complete - unfortunately. All the file and uri
related members are not set - even worse: they are not even set to NULL
but contain garbage :-/.
This is funny and irritating to me... I think that it must be possible
somehow, to get at a more valuable request_rec during the hook
processing, but I did not find out how... The Apache API is very poorly
documented :-(.
It would be nice if someone who has more experience with the Apache2 API
could try to fix this or point me at a way to get it "right"... Maybe
the module itself is responsible for setting the file and uri members to
the appropriate request_rec?
Eckhard
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: Rivet Apache 2
Posted by Eckhard Lehmann <ec...@gmx.de>.
Am Montag, den 09.01.2006, 23:45 +0100 schrieb David N. Welton:
> > The only thing to do for configuration is, to extend the text/html mime
> > type (in $APACHE/conf/mime.types) by the .rvt extension:
> >
> > ...
> > text/html html htm rvt
> > ...
>
> I don't think that's quite right... we don't want the Rivet handler to
> parse html files...does it try to?
No, it does not. I have created a translate function, registered with
ap_hook_translate_name(). It checks for the file ending - which is done
by parsing the request_rec::args field. This seems to be the only place
where the file (relative to the server root) is accessible as
/file.rvt?param1=value1¶m2=value2 ...
It sets the request_rec::filename member to the complete file. I let the
handlers (Rivet_SendContent and Rivet_TranslateUri) return DECLINED, if
the extension is not .rvt:
...
if (!Rivet_IsRivetFile(r->filename))
return DECLINED;
...
I have a problem here: the request_rec, which is given as argument to
the handlers, is not complete - unfortunately. All the file and uri
related members are not set - even worse: they are not even set to NULL
but contain garbage :-/.
This is funny and irritating to me... I think that it must be possible
somehow, to get at a more valuable request_rec during the hook
processing, but I did not find out how... The Apache API is very poorly
documented :-(.
It would be nice if someone who has more experience with the Apache2 API
could try to fix this or point me at a way to get it "right"... Maybe
the module itself is responsible for setting the file and uri members to
the appropriate request_rec?
Eckhard
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: Rivet Apache 2
Posted by "David N. Welton" <da...@dedasys.com>.
Eckhard Lehmann wrote:
>>Well - with Subversion, we can rename files and maintain version
>>history, so let's just pick one and go with it. Barring something
>>better, mod_rivet22.c is fine - either that or put it in an apache2.2/
>>directory.
> The last is a good choice, I think. I have put all the files from src/
> into a new subdirectory src/apache-2, furthermore I moved the Apache1.3
> source files from src/ to a new subdirectory src/apache-1. I added a new
> toplevel Makefile.am in src/ and one Makefile.am in each of the both new
> subdirectories.
> configure.ac has some new macros now:
Great, this looks like a sensible way of organizing things... but I
think we could still improve it just a bit - some of the code, like
TclWeb.c and rivetCore.c is supposed to be independant of the server, so
it should go in the main src/ directory if possible... Actually, the
idea was that TclWebapache.c would be the template for TclWebapache2.c,
etc... But generally it looks good!
> - APACHE -- adds support for --with-apache switch to define the apache
> base directory
> - APACHE_INCLUDE -- adds support for --with-apache-include, to define
> the apache include directories. On some systems the include's may be not
> in the standard locations.. e.g. on debian they are
> in /usr/include/apache${version}.
> - APR_INCLUDE -- same as above for --with-apr-include. Both macros check
> the base directory that was set by APACHE.
> - APACHE_VERSION -- support for the switch --apache-version, either "1"
> or "2". Default setting is currently "2". sets the source directory to
> apache-1 or apache-2, so that rivet is compiled for the appropriate
> version.
Cool.
> However, I did not check whether this all works with Apache1.x...
I will do that this week.
>>The auto* stuff is a "pain in the ass"...
> Oh yeah :-/! I thought about a build system for Tcl extensions in Tcl
> all the time. It wouldn't be that complicated - but it would be
> reinventing the wheel...
Rivet originally had such a system (it's still floating around in
subversion, I think), but... people seem to look at it and think 'weird!'.
>>, so worry first about the C code, and the other stuff will follow.
> Well, I would like to have these things finished when I send the code to
> you and others, so that you/they can start to play with it immediately,
> without worrying about these nasty details.
Yes, having it build would be nice:-)
>>Do, however, separate the .c code into two different files, so that
>>you're not #ifdef'ing everything!
> No #ifdef's, I see, we agree on that :-). That would be IMO the poorest
> solution.
>>In short, if you want to make sure someone else has a copy of the code,
>>by all means, send it to me, but please, please discuss your work
>>publically on the mailing list!
> I have subscribed to the rivet-dev right now, and will summarize my work
> there, as soon as the confirmation emails are done. Meanwhile, I send a
> tar.gz file to you.
Great:-)
> Could you please check it into the subversion repository, if
> appropriate? I can do anonymous checkouts to see the changes from other
> people...
Let me get a chance to test it out some, and then I'll do that.
>>diff -n can handle new files. It's one of those programs that has an
>>option for *everything*, although no one knows them all:-)
> I will try it out :-).
> The only thing to do for configuration is, to extend the text/html mime
> type (in $APACHE/conf/mime.types) by the .rvt extension:
>
> ...
> text/html html htm rvt
> ...
I don't think that's quite right... we don't want the Rivet handler to
parse html files...does it try to?
> No other configuration is necessary, the application/x-httpd-rivet
> handler is also not necessary any more, for Apache2. I have not found a
> way to handle this, instead I got mystic crashes, when I set the request
> handler (request_rec::handler) to "application/x-httpd-rivet".
> I don't know whether this is the best solution, but it can be changed
> whenever we want.
Well, let's get it in subversion, and then go from there with
improving/extending it.
Thanks again:-)
--
David N. Welton
- http://www.dedasys.com/davidw/
Linux, Open Source Consulting
- http://www.dedasys.com/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org