cvs commit: modperl-2.0/t/response/TestCompat conn_authen.pm
geoff 2003/02/19 06:14:36 Modified:.Changes lib/Apache compat.pm t/response/TestCompat conn_authen.pm Log: fixes to Apache::compat. make $r-connection-auth_type interface with r-ap_auth_type. make both $r-connection-auth_type and $r-connection-user writable Submitted by: geoff Reviewed by: stas Revision ChangesPath 1.129 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.128 retrieving revision 1.129 diff -u -r1.128 -r1.129 --- Changes 19 Feb 2003 14:12:01 - 1.128 +++ Changes 19 Feb 2003 14:14:35 - 1.129 @@ -10,6 +10,10 @@ =item 1.99_09-dev +fixes to Apache::compat. make $r-connection-auth_type interface +with r-ap_auth_type. make both $r-connection-auth_type and +$r-connection-user writable. [Geoffrey Young] + Open up r-ap_auth_type, making it possible to write custom authen handlers that don't rely on Basic authentication or it's associated ap_* functions. 1.80 +2 -2 modperl-2.0/lib/Apache/compat.pm Index: compat.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v retrieving revision 1.79 retrieving revision 1.80 diff -u -r1.79 -r1.80 --- compat.pm 17 Feb 2003 09:47:31 - 1.79 +++ compat.pm 19 Feb 2003 14:14:36 - 1.80 @@ -538,8 +538,8 @@ # auth_type and user records don't exist in 2.0 conn_rec struct # 'PerlOptions +GlobalRequest' is required -sub auth_type { Apache-request-auth_type } -sub user { Apache-request-user } +sub auth_type { shift; Apache-request-ap_auth_type(@_) } +sub user { shift; Apache-request-user(@_) } 1; __END__ 1.2 +33 -5 modperl-2.0/t/response/TestCompat/conn_authen.pm Index: conn_authen.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestCompat/conn_authen.pm,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- conn_authen.pm12 Feb 2003 23:42:23 - 1.1 +++ conn_authen.pm19 Feb 2003 14:14:36 - 1.2 @@ -1,6 +1,6 @@ package TestCompat::conn_authen; -# simply check that we can retrieve: +# compat checks for # $r-connection-auth_type # $r-connection-user # both records don't exist in 2.0 conn_rec and therefore require @@ -16,19 +16,47 @@ use Apache::Constants qw(OK REMOTE_HOST); sub handler { + my $r = shift; +my $req_auth_type = $r-connection-auth_type || ''; + +die request auth_type is '$req_auth_type', should be empty +if $req_auth_type; + +# get_basic_auth_pw populates $r-user and $r-ap_auth_type my($rc, $sent_pw) = $r-get_basic_auth_pw; return $rc if $rc != Apache::OK; -my $auth_type = $r-connection-auth_type || ''; -die auth_type is '$auth_type', should be 'Basic' -unless $auth_type eq 'Basic'; +$req_auth_type = $r-connection-auth_type || ''; + +die request auth_type is '$req_auth_type', should be 'Basic' +unless $req_auth_type eq 'Basic'; + +my $config_auth_type = $r-auth_type || ''; + +die httpd.conf auth_type is '$config_auth_type', should be 'Basic' +unless $config_auth_type eq 'Basic'; my $user = $r-connection-user || ''; -die user is '$user', while expecting 'dougm' + +die user is '$user', should be 'dougm' unless $user eq 'dougm'; + +# make sure we can set both +$r-connection-auth_type('sailboat'); +$r-connection-user('geoff'); + +$user = $r-connection-user || ''; + +die user is '$user', should be 'geoff' +unless $user eq 'geoff'; + +$req_auth_type = $r-connection-auth_type || ''; + +die request auth_type is '$req_auth_type', should be 'sailboat' +unless $req_auth_type eq 'sailboat'; OK; }
cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm
stas2003/02/19 15:55:23 Modified:.Changes lib/Apache compat.pm t/response/TestCompat apache.pm xs/Apache/Response Apache__Response.h xs/maps modperl_functions.map xs/tables/current/ModPerl FunctionTable.pm Log: move $r-send_http_header implementation to Apache::compat. This allows the 1.0 code to run unmodified if $r-send_http_header is called before the response change. we already handle the check whether content_type was set, when deciding whether the headers are to be parsed inside modperl_wbucket_pass(). Revision ChangesPath 1.130 +6 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.129 retrieving revision 1.130 diff -u -r1.129 -r1.130 --- Changes 19 Feb 2003 14:14:35 - 1.129 +++ Changes 19 Feb 2003 23:55:22 - 1.130 @@ -10,6 +10,12 @@ =item 1.99_09-dev +move $r-send_http_header implementation to Apache::compat. This +allows the 1.0 code to run unmodified if $r-send_http_header is +called before the response change. we already handle the check whether +content_type was set, when deciding whether the headers are to be +parsed inside modperl_wbucket_pass(). [Stas] + fixes to Apache::compat. make $r-connection-auth_type interface with r-ap_auth_type. make both $r-connection-auth_type and $r-connection-user writable. [Geoffrey Young] 1.81 +5 -0 modperl-2.0/lib/Apache/compat.pm Index: compat.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v retrieving revision 1.80 retrieving revision 1.81 diff -u -r1.80 -r1.81 --- compat.pm 19 Feb 2003 14:14:36 - 1.80 +++ compat.pm 19 Feb 2003 23:55:23 - 1.81 @@ -154,6 +154,11 @@ return Apache::current_callback(); } +sub send_http_header { +my ($r, $type) = @_; +$r-content_type($type) if defined $type; +} + #to support $r-server_root_relative *server_root_relative = \Apache::server_root_relative; 1.5 +3 -0 modperl-2.0/t/response/TestCompat/apache.pm Index: apache.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestCompat/apache.pm,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- apache.pm 17 Feb 2003 09:03:17 - 1.4 +++ apache.pm 19 Feb 2003 23:55:23 - 1.5 @@ -55,3 +55,6 @@ 1; +__END__ +# so we can test whether send_httpd_header() works fine +PerlOptions +ParseHeaders 1.9 +0 -22 modperl-2.0/xs/Apache/Response/Apache__Response.h Index: Apache__Response.h === RCS file: /home/cvs/modperl-2.0/xs/Apache/Response/Apache__Response.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Apache__Response.h17 Jan 2003 02:26:31 - 1.8 +++ Apache__Response.h19 Feb 2003 23:55:23 - 1.9 @@ -13,28 +13,6 @@ rcfg-wbucket-header_parse = 0; \ } -/* XXX: should only be part of Apache::compat */ -static MP_INLINE void -mpxs_Apache__RequestRec_send_http_header(pTHX_ request_rec *r, - const char *type) -{ -MP_dRCFG; - -if (type) { -ap_set_content_type(r, apr_pstrdup(r-pool, type)); -} - -if (rcfg-wbucket) { -/* turn off PerlOptions +ParseHeaders */ -rcfg-wbucket-header_parse = 0; -} -else { -/* the response is not initialized yet */ -Perl_croak(aTHX_ send_http_header() can't be called before - the response phase); -} -} - static MP_INLINE void mpxs_Apache__RequestRec_set_last_modified(request_rec *r, apr_time_t mtime) { 1.54 +0 -1 modperl-2.0/xs/maps/modperl_functions.map Index: modperl_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- modperl_functions.map 17 Feb 2003 09:03:17 - 1.53 +++ modperl_functions.map 19 Feb 2003 23:55:23 - 1.54 @@ -56,7 +56,6 @@ MODULE=Apache::Response PACKAGE=Apache::RequestRec DEFINE_send_cgi_header | | request_rec *:r, SV *:buffer - mpxs_Apache__RequestRec_send_http_header | | r, type=NULL mpxs_Apache__RequestRec_set_last_modified | | r, mtime=0 1.105 +0 -18 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm Index: FunctionTable.pm
cvs commit: modperl-2.0 STATUS
stas2003/02/19 16:41:51 Modified:.STATUS Log: need to resolve the issue with END blocks Revision ChangesPath 1.34 +5 -1 modperl-2.0/STATUS Index: STATUS === RCS file: /home/cvs/modperl-2.0/STATUS,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- STATUS15 Jan 2003 05:22:53 - 1.33 +++ STATUS20 Feb 2003 00:41:51 - 1.34 @@ -50,6 +50,10 @@ Needs Patch or Further Investigation: - +* child processes never run END blocks. a good example is + Apache::TestUtil, which doesn't cleanup files and dirs it has + created, because the END block is not run. + * Currently modperl_filter_add_{connection|request} check the filter handler function attrs before accepting the filter. If the module wasn't preloaded the check fails and filter handler is skipped. We
cvs commit: modperl-2.0 Changes
stas2003/02/19 17:28:25 Modified:t/response/TestAPI uri.pm xs/APR/URI APR__URI.h .Changes Log: fix a bug for apr 0.9.3, where it segfaults in apr_uri_unparse, if hostname is set, but not the scheme. Revision ChangesPath 1.9 +13 -1 modperl-2.0/t/response/TestAPI/uri.pm Index: uri.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/uri.pm,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- uri.pm14 May 2002 01:32:50 - 1.8 +++ uri.pm20 Feb 2003 01:28:24 - 1.9 @@ -4,6 +4,7 @@ use warnings FATAL = 'all'; use Apache::Test; +use Apache::TestUtil; use APR::URI (); use Apache::URI (); @@ -17,7 +18,7 @@ sub handler { my $r = shift; -plan $r, tests = 14; +plan $r, tests = 15; $r-args('query'); @@ -49,6 +50,17 @@ $parsed-path($path); ok $parsed-path eq $path; + +{ +# test the segfault in apr 0.9.3 (fixed on mod_perl side) +# passing only the /path +my $parsed = APR::URI-parse($r-pool, $r-uri); +# set hostname, but not the scheme +$parsed-hostname($r-get_server_name); +$parsed-port($r-get_server_port); +#$parsed-scheme('http'); +ok t_cmp($r-construct_url, $parsed-unparse); +} my $newr = Apache::RequestRec-new($r-connection, $r-pool); my $url_string = $path?query; 1.5 +9 -0 modperl-2.0/xs/APR/URI/APR__URI.h Index: APR__URI.h === RCS file: /home/cvs/modperl-2.0/xs/APR/URI/APR__URI.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- APR__URI.h14 May 2002 01:32:50 - 1.4 +++ APR__URI.h20 Feb 2003 01:28:24 - 1.5 @@ -3,6 +3,15 @@ apr_uri_t *uptr, unsigned flags) { + +/* XXX: check that my patch was actually applied in apr v9.3 */ +#if APR_MINOR_VERSION == 9 APR_PATCH_VERSION 3 +/* apr 0.9.3 segfaults if hostname is set, but scheme is not */ +if (uptr-hostname !uptr-scheme) { +uptr-scheme = http; +} +#endif + return apr_uri_unparse(((modperl_uri_t *)uptr)-pool, uptr, flags); } 1.131 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.130 retrieving revision 1.131 diff -u -r1.130 -r1.131 --- Changes 19 Feb 2003 23:55:22 - 1.130 +++ Changes 20 Feb 2003 01:28:25 - 1.131 @@ -10,6 +10,9 @@ =item 1.99_09-dev +fix a bug for apr 0.9.3, where it segfaults in apr_uri_unparse, if +hostname is set, but not the scheme. [Stas] + move $r-send_http_header implementation to Apache::compat. This allows the 1.0 code to run unmodified if $r-send_http_header is called before the response change. we already handle the check whether