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 Valery Masiutsin <va...@gmail.com> on 2007/10/17 18:37:19 UTC
Fresh patches (Rivet_IsRivetFile patch included)
Hello,guys !
Here's more patches.
1.doc_Makefile_am.diff - simple oneliner fixes make clean in docs.
2.src_apache-2_Makefile_am.diff
Fixes includes, otherwise macros expansion breakes, ApacheRequest_upload is a
good example, it compiles fine but you are getting undefined symbol
once you are calling it.
N.B. probably mod_rivet for apache-1 in trunk suffers this as well,
need to check.
3.configure_ac.diff - added APACHE2 define to config.h
4.src_apache2_mod_rivet_c.diff
Rivet_CheckType function i've sent earlier,
I've deleted Rivet_ParseUri function - dont see much sense in its
existence at this moment - it's broken anyway.
Added ap_chdir_file function implementation for apache2 - did not
reinvent the wheel, and grabbed it from mod_ruby, we can rewrite it if
it needs so, or include it as it is, with clearly marked credits.
5.src_apache-2_apache_request_h.diff
Changed prototype of ApacheRequest_tmpfile function to return
apr_file_t instead of FILE, also modified ApacheUpload structure - did
same change.
6. src_apache-2_apache_request_c.diff
Completely rewrote ApacheRequest_tmpfile function using apr functions,
questionable part is a filename generation for tmp files.
Next some changes to ApacheRequest_parse_multipart (enough to make it work).
Ideas were taken from apache module book.
7.src_apache-2_TclWebapache_c.diff
Rewrote TclWeb_UploadSave function - i did not found the way to get
fileno() handler from apr_file_t() so i replaced all stuff with
single apr_file_copy() function, which just copies file from tmp to
target one, probably need to add here checks for
maxsize and UploadDirectory.
Because of changes ApacheUpload* stuff i had to do some typecasting on
functions in TclWebapache.c - just to repair the build, they are not
usable at the moment.
With all this i was able to perform file upload using
doc/examples/upload* pages.
My intension is to leave function interface in TclWebapache as it is
for apache2, but all internals probably will be rewritten using apr_*
functions equivalents. Apache/apr community insists that they are
cross-platform safe, may be they right, but anyway it will simplify
things a good bit.
All comments are welcome.
Regards Valery.
Re: Fresh patches (Rivet_IsRivetFile patch included)
Posted by Massimo Manghi <ma...@unipr.it>.
David Welton wrote:
>
> Massimo - do you have the time to commit Valery's patches?
>
>
I'm going to commit. I bumped up the version in AC_INIT because
trunk was behind 1_0 and it didn't make sense. I also reestablished
the version number in the target directory of the libraries. I didn't
ask permission from the list in order to limit the traffic
which is unusually high for rivet-dev ( wow :-) ) and because it seems
to me reasonable if one has more the one rivet version around
in the system. I also fixed a message in configure.ac.
The commit is taking place soon.
-- Massimo
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: Fresh patches (Rivet_IsRivetFile patch included)
Posted by Massimo Manghi <ma...@unipr.it>.
Valery Masiutsin wrote:
> Hello, Massimo !
>
> The story with ap_chdir_file is that it was considered useless by
> apache (2 version) developers, and declined. I grabbed a look into
> mod_ruby and mod_python source code to find out how did they sorted
> the issue with its absence. I found that they wrote their own
> implementation of ap_chdir_file for apache2, licence allow us to
> re-use that code. I think it should be moved to separate file with
> full text of original licence, and included by preprocessor if its
> needed.
>
ok, I see now. Is there anything we can do using apache2 infrastructure?
Hooking into the 'translate_name' phase?
-- Massimo
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: Fresh patches (Rivet_IsRivetFile patch included)
Posted by Valery Masiutsin <va...@gmail.com>.
Hello, Massimo !
The story with ap_chdir_file is that it was considered useless by
apache (2 version) developers, and declined. I grabbed a look into
mod_ruby and mod_python source code to find out how did they sorted
the issue with its absence. I found that they wrote their own
implementation of ap_chdir_file for apache2, licence allow us to
re-use that code. I think it should be moved to separate file with
full text of original licence, and included by preprocessor if its
needed.
Regards Valery
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: Fresh patches (Rivet_IsRivetFile patch included)
Posted by Massimo Manghi <ma...@unipr.it>.
David Welton wrote:
>
>> ap_chdir_file was simply commented out (why?). In fact I noticed
>> yesterday that
>> some pages that had nested templates in them were broken.
>> Printing the output of 'pwd' showed that templates were stuck to the
>> documentRoot
>>
>
> Keep in mind that there are also Tcl_ functions, but mixing them can
> be dangerous.
>
>
My test was at the Tcl level in a .rvt file. Do you refer to the
ap_chdir_file call?
In mod_rivet.c there are lots of calls to both ap_ and Tcl_. For what I
can say there is no obvious overlapping in the way mod_rivet uses these
2 libraries. But my opinion should be matched to Valery's opinion.
> Yes, you are on the right track. Any OS level stuff should be done
> through either the apr_ or the Tcl api's. apr_ and Tcl_ give you a
> lot of functionality, so it's often wise to look there prior to doing
> something 'by hand'.
>
> Massimo - do you have the time to commit Valery's patches?
>
>
yes, I'll do it soon.
-- Massimo
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: Fresh patches (Rivet_IsRivetFile patch included)
Posted by Massimo Manghi <ma...@unipr.it>.
In this case we should include the copyright notice in mod_rivet.c (after
ASF copyright notice, I presume)
-- M
Valery Masiutsin wrote:
> Hello, David !
>
> On 10/18/07, David Welton <da...@gmail.com> wrote:
>
>> What's the license for mod_ruby?
>>
> As far as i see from source code it is a BSD-like licence.
> Here it is. The apachereq bits is under apache-2.0 licence.
> --------------------------------------------------
> /*
> * $Id: apachelib.c 93 2005-08-03 01:32:41Z shugo $
> * Copyright (C) 2000 ZetaBITS, Inc.
> * Copyright (C) 2000 Information-technology Promotion Agency, Japan
> * Copyright (C) 2001-2003 Shugo Maeda <sh...@modruby.net>
> * All rights reserved.
> *
> * Redistribution and use in source and binary forms, with or without
> * modification, are permitted provided that the following conditions
> * are met:
> * 1. Redistributions of source code must retain the above copyright
> * notice, this list of conditions and the following disclaimer.
> * 2. Redistributions in binary form must reproduce the above copyright
> * notice, this list of conditions and the following disclaimer in the
> * documentation and/or other materials provided with the distribution.
> *
> *
[...]
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: Fresh patches (Rivet_IsRivetFile patch included)
Posted by Valery Masiutsin <va...@gmail.com>.
Hello, David !
On 10/18/07, David Welton <da...@gmail.com> wrote:
>
> What's the license for mod_ruby?
As far as i see from source code it is a BSD-like licence.
Here it is. The apachereq bits is under apache-2.0 licence.
--------------------------------------------------
/*
* $Id: apachelib.c 93 2005-08-03 01:32:41Z shugo $
* Copyright (C) 2000 ZetaBITS, Inc.
* Copyright (C) 2000 Information-technology Promotion Agency, Japan
* Copyright (C) 2001-2003 Shugo Maeda <sh...@modruby.net>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
--------------------------------------------------
To be totally safe, and for the archives we can email mod_ruby
maintainer cc'ing email to the rivet-dev@.
Regards Valery
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: Fresh patches (Rivet_IsRivetFile patch included)
Posted by David Welton <da...@gmail.com>.
> > I've deleted Rivet_ParseUri function - dont see much sense in its
> > existence at this moment - it's broken anyway.
> > Added ap_chdir_file function implementation for apache2 - did not
> > reinvent the wheel, and grabbed it from mod_ruby, we can rewrite it if
What's the license for mod_ruby?
> ap_chdir_file was simply commented out (why?). In fact I noticed
> yesterday that
> some pages that had nested templates in them were broken.
> Printing the output of 'pwd' showed that templates were stuck to the
> documentRoot
Keep in mind that there are also Tcl_ functions, but mixing them can
be dangerous.
> > Completely rewrote ApacheRequest_tmpfile function using apr functions,
Great! Using apr is the right way to go. However - ApacheRequest
comes from this codebase:
http://httpd.apache.org/apreq/
So have a look, and maybe just grab their 2.0 files.
> > With all this i was able to perform file upload using
> > doc/examples/upload* pages.
Cool:-)
> > My intension is to leave function interface in TclWebapache as it is
> > for apache2, but all internals probably will be rewritten using apr_*
> > functions equivalents. Apache/apr community insists that they are
> > cross-platform safe, may be they right, but anyway it will simplify
> > things a good bit.
Yes, you are on the right track. Any OS level stuff should be done
through either the apr_ or the Tcl api's. apr_ and Tcl_ give you a
lot of functionality, so it's often wise to look there prior to doing
something 'by hand'.
Massimo - do you have the time to commit Valery's patches?
--
David N. Welton
http://www.welton.it/davidw/
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org
Re: Fresh patches (Rivet_IsRivetFile patch included)
Posted by Massimo Manghi <ma...@unipr.it>.
Valery Masiutsin wrote:
> Hello,guys !
>
> Here's more patches.
>
> 1.doc_Makefile_am.diff - simple oneliner fixes make clean in docs.
> 2.src_apache-2_Makefile_am.diff
> Fixes includes, otherwise macros expansion breakes, ApacheRequest_upload is a
> good example, it compiles fine but you are getting undefined symbol
> once you are calling it.
> N.B. probably mod_rivet for apache-1 in trunk suffers this as well,
> need to check.
>
Would you tell me more about this? Your patch is doing this change
-INCLUDES = -I@apache_include@ -I@RIVET_BASE_INCLUDE@
+INCLUDES = -I"." -I@apache_include@ -I@RIVET_BASE_INCLUDE@
I can see the -I . switch during the compilation process for every file (I
presume this is a byproduct of automake)
> I've deleted Rivet_ParseUri function - dont see much sense in its
> existence at this moment - it's broken anyway.
> Added ap_chdir_file function implementation for apache2 - did not
> reinvent the wheel, and grabbed it from mod_ruby, we can rewrite it if
>
ap_chdir_file was simply commented out (why?). In fact I noticed
yesterday that
some pages that had nested templates in them were broken.
Printing the output of 'pwd' showed that templates were stuck to the
documentRoot
> it needs so, or include it as it is, with clearly marked credits.
>
I don't see why we should keep it.
> 5.src_apache-2_apache_request_h.diff
> Changed prototype of ApacheRequest_tmpfile function to return
> apr_file_t instead of FILE, also modified ApacheUpload structure - did
> same change.
>
ok
> 6. src_apache-2_apache_request_c.diff
> Completely rewrote ApacheRequest_tmpfile function using apr functions,
> questionable part is a filename generation for tmp files.
> Next some changes to ApacheRequest_parse_multipart (enough to make it work).
> Ideas were taken from apache module book.
>
BB? (Bucket Brigade) Are you already doing it?
> 7.src_apache-2_TclWebapache_c.diff
> Rewrote TclWeb_UploadSave function - i did not found the way to get
> fileno() handler from apr_file_t() so i replaced all stuff with
> single apr_file_copy() function, which just copies file from tmp to
> target one, probably need to add here checks for
> maxsize and UploadDirectory.
> Because of changes ApacheUpload* stuff i had to do some typecasting on
> functions in TclWebapache.c - just to repair the build, they are not
> usable at the moment.
>
> With all this i was able to perform file upload using
> doc/examples/upload* pages.
> My intension is to leave function interface in TclWebapache as it is
> for apache2, but all internals probably will be rewritten using apr_*
> functions equivalents. Apache/apr community insists that they are
> cross-platform safe, may be they right, but anyway it will simplify
> things a good bit.
> All comments are welcome.
>
> Regards Valery.
>
I'm adding a small patch for a macro in configure.ac (a simple message
to be printed for the apxs program found)
I've done a fresh checkout to try the build system (as it would be now for
a newcomer) and found out that lib_libexec in src/Makefile.am is expanded
into '/usr/lib /rivet' (please note the space char between '/usr/lib'
and '/rivet').
This breaks the installation of librivet, but it seems that I'm the only
person
who is having this problem (I can handle it only hacking the Makefile
by hand, a humbling experience)
-- Massimo
---------------------------------------------------------------------
To unsubscribe, e-mail: rivet-dev-unsubscribe@tcl.apache.org
For additional commands, e-mail: rivet-dev-help@tcl.apache.org