cvs commit: modperl-2.0/xs/APR/OS APR__OS.h
dougm 02/05/22 09:30:14 Added: xs/APR/OS APR__OS.h Log: wrapper for apr_os_thread_current() Revision ChangesPath 1.1 modperl-2.0/xs/APR/OS/APR__OS.h Index: APR__OS.h === static MP_INLINE apr_os_thread_t mpxs_apr_os_thread_current(pTHX) { #if APR_HAS_THREADS return apr_os_thread_current(); #else return (void *)0; #endif }
cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm
dougm 02/05/22 09:30:40 Modified:t/apr.cvsignore xs/maps apr_functions.map apr_types.map xs/tables/current/ModPerl FunctionTable.pm Log: add APR::OS::thread_current function Revision ChangesPath 1.5 +1 -0 modperl-2.0/t/apr/.cvsignore Index: .cvsignore === RCS file: /home/cvs/modperl-2.0/t/apr/.cvsignore,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- .cvsignore6 Mar 2002 05:24:57 - 1.4 +++ .cvsignore22 May 2002 16:30:40 - 1.5 -9,3 +9,4 table.t util.t uuid.t +os.t 1.41 +25 -25modperl-2.0/xs/maps/apr_functions.map Index: apr_functions.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apr_functions.map,v retrieving revision 1.40 retrieving revision 1.41 diff -u -r1.40 -r1.41 --- apr_functions.map 19 May 2002 23:59:52 - 1.40 +++ apr_functions.map 22 May 2002 16:30:40 - 1.41 -591,28 +591,28 apr_xlate_get_sb apr_xlate_open --MODULE=APR::OS - apr_os_dir_get - apr_os_exp_time_get - apr_os_file_get - apr_os_imp_time_get - apr_os_sock_get - apr_os_thread_get - apr_os_threadkey_get - apr_os_sock_make - apr_os_dir_put - apr_os_exp_time_put - apr_os_file_put - apr_os_imp_time_put - apr_os_sock_put - apr_os_thread_put - apr_os_threadkey_put - apr_os_dso_handle_get - apr_os_dso_handle_put - apr_os_thread_current - apr_os_thread_equal - apr_os_global_mutex_get - apr_os_proc_mutex_get - apr_os_proc_mutex_put - apr_os_shm_get - apr_os_shm_put +MODULE=APR::OS +-apr_os_dir_get +-apr_os_exp_time_get +-apr_os_file_get +-apr_os_imp_time_get +-apr_os_sock_get +-apr_os_thread_get +-apr_os_threadkey_get +-apr_os_sock_make +-apr_os_dir_put +-apr_os_exp_time_put +-apr_os_file_put +-apr_os_imp_time_put +-apr_os_sock_put +-apr_os_thread_put +-apr_os_threadkey_put +-apr_os_dso_handle_get +-apr_os_dso_handle_put + apr_os_thread_current | | mpxs_ +-apr_os_thread_equal +-apr_os_global_mutex_get +-apr_os_proc_mutex_get +-apr_os_proc_mutex_put +-apr_os_shm_get +-apr_os_shm_put 1.17 +1 -1 modperl-2.0/xs/maps/apr_types.map Index: apr_types.map === RCS file: /home/cvs/modperl-2.0/xs/maps/apr_types.map,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- apr_types.map 19 May 2002 01:05:30 - 1.16 +++ apr_types.map 22 May 2002 16:30:40 - 1.17 -96,7 +96,7 #thread stuff struct apr_threadkey_t | UNDEFINED struct apr_os_threadkey_t| UNDEFINED -struct apr_os_thread_t | UNDEFINED +struct apr_os_thread_t | PTR struct apr_thread_t | UNDEFINED apr_thread_start_t | UNDEFINED struct apr_threadattr_t | UNDEFINED 1.67 +15 -1 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm Index: FunctionTable.pm === RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v retrieving revision 1.66 retrieving revision 1.67 diff -u -r1.66 -r1.67 --- FunctionTable.pm 21 May 2002 02:50:16 - 1.66 +++ FunctionTable.pm 22 May 2002 16:30:40 - 1.67 -2,7 +2,7 # !! # ! WARNING: generated by ModPerl::ParseSource/0.01 -# ! Mon May 20 19:15:12 2002 +# ! Wed May 22 09:10:46 2002 # ! do NOT edit, any changes will be lost ! # !! -5195,6 +5195,20 { 'type' = 'const char *', 'name' = 'mask_or_numbits' + } +] + }, + { +'return_type' = 'apr_os_thread_t', +'name' = 'mpxs_apr_os_thread_current', +'attr' = [ + 'static', + '__inline__' +], +'args' = [ + { +'type' = 'PerlInterpreter *', +'name' = 'my_perl' } ] },
cvs commit: modperl-2.0/t/response/TestAPR os.pm
dougm 02/05/22 09:31:05 Added: t/response/TestAPR os.pm Log: add test for APR::OS::thread_current Revision ChangesPath 1.1 modperl-2.0/t/response/TestAPR/os.pm Index: os.pm === package TestAPR::os; use strict; use warnings FATAL = 'all'; use Apache::Test; use Apache::TestUtil; use APR::OS (); use Apache::Const -compile = 'OK'; sub handler { my $r = shift; plan $r, tests = 1; my $id = APR::OS::thread_current() || $$; ok t_cmp($id, $id, current thread id or process id); Apache::OK; } 1;
cvs commit: modperl-2.0/lib/Apache Build.pm
dougm 02/05/22 19:35:19 Modified:.Makefile.PL lib/Apache Build.pm Log: on hpux with bleedperl $Config{ld} is the fullpath, strip to the basename Revision ChangesPath 1.84 +2 -1 modperl-2.0/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl-2.0/Makefile.PL,v retrieving revision 1.83 retrieving revision 1.84 diff -u -r1.83 -r1.84 --- Makefile.PL 22 May 2002 02:07:08 - 1.83 +++ Makefile.PL 23 May 2002 02:35:19 - 1.84 -344,8 +344,9 sub os_check_hpux { my $ccflags = $build-perl_config('ccflags'); +my $ld = $build-perl_config('ld'); -if ($build-is_dynamic and $Config{ld} eq 'ld') { +if ($build-is_dynamic and $ld eq 'ld') { unless ($ccflags =~ /\+z/i) { $build-phat_warn(EOF); mod_perl is unlikely to link with your libperl, suggestions: 1.92 +11 -1 modperl-2.0/lib/Apache/Build.pm Index: Build.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v retrieving revision 1.91 retrieving revision 1.92 diff -u -r1.91 -r1.92 --- Build.pm 22 May 2002 01:58:59 - 1.91 +++ Build.pm 23 May 2002 02:35:19 - 1.92 -172,7 +172,9 my $ldopts = ExtUtils::Embed::ldopts(); chomp $ldopts; -if ($^O eq 'hpux' and $Config{ld} eq 'ld') { +my $ld = $self-perl_config('ld'); + +if ($^O eq 'hpux' and $ld eq 'ld') { while ($ldopts =~ s/-Wl,(\S+)/$1/) { my $cp = $1; (my $repl = $cp) =~ s/,/ /g; -275,6 +277,14 } $val; +} + +sub perl_config_ld { +my($self, $val) = _; + +$val ||= $Config{ld}; + +basename $val; #bleedperl hpux value is /usr/bin/ld ! } sub perl_config_lddlflags {
cvs commit: modperl-2.0/lib/Apache compat.pm
dougm 02/05/22 20:10:18 Modified:lib/Apache compat.pm Log: add noop stubs for timeout functions removed from 2.0: $r-{soft,hard,reset,kill}_timeout Revision ChangesPath 1.46 +6 -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.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- compat.pm 19 May 2002 11:41:53 - 1.45 +++ compat.pm 23 May 2002 03:10:18 - 1.46 -91,6 +91,12 package Apache::RequestRec; +#no longer exist in 2.0 +sub soft_timeout {} +sub hard_timeout {} +sub kill_timeout {} +sub reset_timeout {} + #to support $r-server_root_relative *server_root_relative = \Apache::server_root_relative;
cvs commit: modperl-2.0/src/modules/perl modperl_callback.c
dougm 02/05/22 22:55:35 Modified:src/modules/perl modperl_callback.c Log: prevent possible segv with method handlers? Revision ChangesPath 1.50 +6 -1 modperl-2.0/src/modules/perl/modperl_callback.c Index: modperl_callback.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- modperl_callback.c18 May 2002 01:07:16 - 1.49 +++ modperl_callback.c23 May 2002 05:55:35 - 1.50 -16,7 +16,12 PUSHMARK(SP); if (MpHandlerMETHOD(handler)) { -GV *gv = modperl_mgv_lookup(aTHX_ handler-mgv_obj); +GV *gv; +if (!handler-mgv_obj) { +Perl_croak(aTHX_ panic: %s method handler object is NULL!, + handler-name); +} +gv = modperl_mgv_lookup(aTHX_ handler-mgv_obj); XPUSHs(modperl_mgv_sv(gv)); }
Re: GTop
On Tue, 21 May 2002 19:57:35 -0500, Gregory Matthews [EMAIL PROTECTED] said: GK [..snip..] GK My glib-config directory is /usr/local/bin and the name of the actual GK file is glib12-config. GK How can I tell GTop where this file is and what the actual file name GK is? Don't ask me why my server named it that way, but when doing ### a GK %locate glib command, I get (you'll see the glib12-config file down GK towards the bottom): Just patch Makefile.PL of GTop. Replace string glib-config with glib12-config in top level Makefile.PL and in Server/Makefile.PL -- Ilya Martynov (http://martynov.org/)
Re: #perl SSI directive not recognised
Doug MacEachern wrote: the #perl directive is disabled if modperl is built as dso, Makefile.PL prints a message about this. won't be an issue with 2.0 thanks to apr optional functions. but in 1.x, the modperl .so cannot resolve symbols from mod_include.so. at least, it can't on all platforms and can't if one were to disable LoadModule of mod_include.so Thanks Doug. I'm using the Apache/perl/mod_perl that will ship as part of Solaris 9, so I was a little concerned that we'd screwed something up :-) From your description, I'm guessing that the root cause of this that that two dlopen'ed shared objects need to be able to cross-call each other, correct? This might not be of much use if you already have a fix for 2.0, but I have a little trick which makes this work on Solaris, at least. You stick the following in the call to WriteMakefile in Makefile.PL dynamic_lib = { OTHERLDFLAGS = '-h $(DLBASE).$(DLEXT) ' . '-R\$$ORIGIN/.. $(INST_ARCHAUTODIR)/../OtherModule.so' }, The '-h' establishes a location-independent name for the XSUB you are currently building. The '-R' establishes a runpath to search for the other .so that you want to link against, and the MyOtherModule.so bit says where to find the other .so, relative to the obe you are currently building. Here is a bit more info from a Makefile.PL where I actually use this trick: # The various .so files that comprise this module need to be able to # cross-call each other, and therefore to prevent runtime linker errors it is # necessary to establish linker dependencies between the various .so files. # # This causes several problems. The first of these is that perl .so files are # built in one directory (under ../blib in this case) and installed into # another, so it is necessary to record the dependency using a path relative to # the dependent. This can be done with the $ORIGIN linker mechanism. # # The second problem is that it is necessary to specify the name of the # dependee at link edit time in a manner that doesn't result in the build-time # path of the dependee being hard coded in to the dependent, as this would # stop ld.so.1 performing its normal search process for the files. This can't # be done with the normal '--L/my/lib/path -lmylib' mechanism, because the XSUB # .so files aren't prefixed with 'lib'. To do this the -h linker flag is used # to explicitly set the SONAME in the dependee. This is then used as the name # of the dependent in the dependee rather than the full path by which it was # found at link edit time. The appropriate bits of a 'dump -Lv of the resulting .so file are: [INDEX] Tag Value [1] NEEDED OtherModule.so -- Dependency [4] SONAME ThisModule.so -- Name of this module [5] RUNPATH $ORIGIN/.. -- Where to search [6] RPATH $ORIGIN/.. Hope this might help somebody sometime - it may be possible to pull a similar stunt on other platforms. Alan Burlison
Re: compile time errors
Jie Gao wrote: On Tue, 21 May 2002, m31 wrote: I'm sorry (i wass in a rush), the errors come up when I run make test, the `perl Makefile.pl` works fine. (on OSX 10.1.4 (Darwin 5.4), Perl/5.6.0, mod_perl/1.25, apache/1.3.23) $ make test ...some more stuff /usr/bin/perl t/TEST 0 Can't locate object method new via package URI::URL at ../blib/lib/Apache/test.pm line 252. make: *** [run_tests] Error 255 http://groups.yahoo.com/group/modperl/message/42895 Jie Thankx, I added use URI::URL and I get past that but now it tells me: /httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t zsh: no such file or directory: /httpd httpd listening on port 8529 will write error_log to: t/logs/error_log letting apache warm up...\c done /usr/bin/perl t/TEST 0 still waiting for server to warm up...not ok server failed to start! (please examine t/logs/error_log) at t/TEST line 95. make: *** [run_tests] Error 22 I check t/log/.. and there's nothing in there, I have a full working vers of apache running, so I'm asuming its trying to make a fake request for testing. Any ideas?
Re: compile time errors
m31 wrote: Jie Gao wrote: On Tue, 21 May 2002, m31 wrote: I'm sorry (i wass in a rush), the errors come up when I run make test, the `perl Makefile.pl` works fine. (on OSX 10.1.4 (Darwin 5.4), Perl/5.6.0, mod_perl/1.25, apache/1.3.23) $ make test ...some more stuff /usr/bin/perl t/TEST 0 Can't locate object method new via package URI::URL at ../blib/lib/Apache/test.pm line 252. make: *** [run_tests] Error 255 http://groups.yahoo.com/group/modperl/message/42895 Jie Thankx, I added use URI::URL and I get past that but now it tells me: /httpd -f `pwd`/t/conf/httpd.conf -X -d `pwd`/t zsh: no such file or directory: /httpd do you pay attention to the printouts? See above. httpd listening on port 8529 will write error_log to: t/logs/error_log letting apache warm up...\c done /usr/bin/perl t/TEST 0 still waiting for server to warm up...not ok server failed to start! (please examine t/logs/error_log) at t/TEST line 95. make: *** [run_tests] Error 22 I check t/log/.. and there's nothing in there, I have a full working vers of apache running, so I'm asuming its trying to make a fake request for testing. Any ideas? -- __ Stas BekmanJAm_pH -- Just Another mod_perl Hacker http://stason.org/ mod_perl Guide --- http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
Re: What causes memory leaks during graceful restarts?
At 6:56 PM -0700 5/21/02, Doug MacEachern wrote: On Tue, 21 May 2002, Dan Wilga wrote: I am using Perl 5.6.1, modperl 1.25, and yes it's a DSO. It's compiled with: with 1.25, you can also set the PERL_DESTRUCT_LEVEL environment variable to 2, either before starting the server: export PERL_DESTRUCT_LEVEL=2 apachectl start or using PerlSetEnv in httpd.conf the fix in modperl-1.26 is simply to use that value by default. Interesting. When I do that, I get the same problem I did when I tried to run with 1.25_01 and 1.26: Apache core dumps. I think I'll have to try compiling it again with the latest version of mod_perl, and perhaps not as a DSO. Dan Wilga [EMAIL PROTECTED] Web Technology Specialist http://www.mtholyoke.edu Mount Holyoke CollegeTel: 413-538-3027 South Hadley, MA 01075Seduced by the chocolate side of the Force
[OT] Re: Image::Size, TT, and mod_perl Question
On Tue, 21 May 2002, Mike Melillo wrote: Hey, Mikey! Date: Tue, 21 May 2002 23:28:29 -0400 From: Mike Melillo [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Image::Size, TT, and mod_perl Question I posed this question to the Template Toolkit list and got no response, so I figured I'd give this list a shot... - Hello, below is some code I have in a mod_perl handler that checks to see if an uploaded image is less than 300 pixels tall or wide. Everything seems to be working except the fact that the template is not returning with the proper values processed. Below is the code and the err_log output when I output an image that is too wide. [snip] my $upload = $r-upload; my $type= $upload-type; my $fh = $upload-fh; my $username= $r-param('username'); my ($x, $y) = imgsize($fh); print STDERR Dumper($x); print STDERR Dumper($y); unless ($x 300) { print STDERR the greater than works\n; # This checks to make sure the image isnt more than 300 x 300 my %vars = {TOO_WIDE = 1}; You're creating the hash incorrectly. Do either: my %vars = ( TOO_WIDE = 1 ); or my $vars = { TOO_WIDE = 1 }; ky my $config = { INCLUDE_PATH = '/moc/html/templates', POST_CHOMP = 1, EVAL_PERL = 1, }; my $template = Template-new($config) || die New Template Failed: $!\n; #the process method prints the template out to the browser via $r $template-process('pic_upload.tt2', \%vars, $r) || do { $r-log_reason($template-error()); return SERVER_ERROR; }; return OK; } # end of X/Y coordinate if [snip] The err_log output: $VAR1 = 310; $VAR1 = 72; the greater than works [end of err_log] The problem is the template pic_upload.tt2 has this in it: [% IF TOO_WIDE %] font color=redYour File was too big. Make it under 30K/fontp [% END %] But that isn't showing up. I do the almost identical thing immediately after this if clauses to check if the file's type is a jpeg. That works, so I don't understand what I pasted in wrong, or forgot to paste in. Mike -- # - # k e nKen Y. Clark # r y [EMAIL PROTECTED] # a l c972-542-7923 # -
Re: What causes memory leaks during graceful restarts?
On Wed, 22 May 2002, Dan Wilga wrote: Interesting. When I do that, I get the same problem I did when I tried to run with 1.25_01 and 1.26: Apache core dumps. I think I'll have to try compiling it again with the latest version of mod_perl, and perhaps not as a DSO. possible that your are hitting the XSLoader vs. DynaLoader problem, where the list of dlhandles can be wiped out. try adding 'use DynaLoader ();' to your startup.pl before any other module is loaded.
Re: #perl SSI directive not recognised
On Wed, 22 May 2002, Alan Burlison wrote: Thanks Doug. I'm using the Apache/perl/mod_perl that will ship as part of Solaris 9, so I was a little concerned that we'd screwed something up :-) maybe solaris 9 should include 2.0 instead ;-) From your description, I'm guessing that the root cause of this that that two dlopen'ed shared objects need to be able to cross-call each other, correct? right. This might not be of much use if you already have a fix for 2.0, but I have a little trick which makes this work on Solaris, at least. You stick the following in the call to WriteMakefile in Makefile.PL dynamic_lib = { OTHERLDFLAGS = '-h $(DLBASE).$(DLEXT) ' . '-R\$$ORIGIN/.. $(INST_ARCHAUTODIR)/../OtherModule.so' }, interesting trick. probably won't attempt it for modperl-1.27 tho, since it likely won't work on some platforms and the #perl include feature isn't very high demand.
Re: What causes memory leaks during graceful restarts?
At 8:41 AM -0700 5/22/02, Doug MacEachern wrote: On Wed, 22 May 2002, Dan Wilga wrote: Interesting. When I do that, I get the same problem I did when I tried to run with 1.25_01 and 1.26: Apache core dumps. I think I'll have to try compiling it again with the latest version of mod_perl, and perhaps not as a DSO. possible that your are hitting the XSLoader vs. DynaLoader problem, where the list of dlhandles can be wiped out. try adding 'use DynaLoader ();' to your startup.pl before any other module is loaded. Oh ho! That's it. Now when I gracefully restart, the memory loss is only about 29 Kb -- a very reasonable number. So if that's the reason for the core dump, is there a bug fix to the offending module in the works? Dan Wilga [EMAIL PROTECTED] Web Technology Specialist http://www.mtholyoke.edu Mount Holyoke CollegeTel: 413-538-3027 South Hadley, MA 01075Got Perl?
Parse::RecDescent under mod_perl
Hi I Can't get this module to run under mod_perl. I have installed this module on my machine and the script when called from command line works fine. But When called from within Apache from a mod_perl script, it fails to instantiate Parse::RecDescent Module. I wrapped the 'Parse::RecDescent-new($grammar)' call in 'eval' and printed out '$' after in a file. Here is the error : Unknown starting rule (Parse::RecDescent::0::Replace) called at EXPR_EVAL.pm line 20. Line 20 is : $p=Parse::RecDescent-new($grammar) It dies inside RecDescent.pm at the end of 'sub new': $self-Replace(_) I can see the 'Replace' routine a few lines below. Why can't it find 'Replace' when it did find 'sub new' in the same package and same file? Again, the same module (EXPR-EVAL.pm) runs just fine when called from a script on the command line! Any suggestions are welcome. = - Praveen __ Do You Yahoo!? LAUNCH - Your Yahoo! Music Experience http://launch.yahoo.com
Reloading Modules
Hi again, I'm having trouble seeing module changes when I reload a script that uses it. I'm using Apache::Reload and my test script/module is as follows: test.pl #!/usr/local/bin/perl use strict; use warnings; use My::Test qw(:subs); print Content-type: text/plain\r\n\r\n; test1(); Test.pm package My::Test; use strict; use warnings; BEGIN { use Exporter (); our (ISA, EXPORT, EXPORT_OK, %EXPORT_TAGS); ISA = qw(Exporter); EXPORT= qw(); EXPORT_OK = qw(); %EXPORT_TAGS = ( subs = [qw(test1)], ); Exporter::export_ok_tags('subs'); } sub test1 { print In test1 func\n; } 1; When I modify sub test1, and I reload - no changes appear in the browser. The following gets printed to error_log: Subroutine test1 redefined at /export/home/httpd/cgi-bin/My/Test.pm line 22. When I touch test.pl - the changes appear. The following gets printed to error_log: Subroutine test1 redefined at /export/home/httpd/cgi-bin/My/test.pl line 5 Finally, if I add a new subroutine test2 to Test.pm, export it, and update the test.pl script to call test2, the script fails with an Internal Server Error. The following gets printed to error_log: test2 is not exported by the My::Test module at /export/home/httpd/cgi-bin/My/test.pl line 5 [Wed May 22 15:26:12 2002] [error] Can't continue after import errors at /export/home/httpd/cgi-bin/My/test.pl line 5 BEGIN failed--compilation aborted at /export/home/httpd/cgi-bin/ My/test.pl line 5. Then, when I restart the server, the script runs fine. Thank you for any help you can provide, Ted
How to proxy everything except selected urls?
I the past, when I've setup a proxy/app server configuration, it's always been to forward certain url's to the app server, with the rest being processed by the proxy. However, I need to turn this around. I want to pass everything to the app server, except for some url's that point at static content (images, mostly). I initially thought something like this would work: --- ProxyPass On ProxyPass / http://other.server.com:1234/ ProxyPassReverse/ http://other.server.com:1234/ alias /graphics /local/path --- However, /graphics also get's proxied to the app server. This isn't what I want. I don't think mod_proxy can do this; at least it's not clear to me how to if it does support this feature. Would mod_rewrite be a better solution? Match on the URL's that I want processed locally (and stop), else map the url to the app server, and forward the request? What's the best way to do this? (in case you're wondering, the back-end app server will be generating most of the content dynamically; I could just have a set of heavy servers, but I'm trying to offload what I can to a lighter front-end. In the end, however, it may not be worth the effort, since the number of static files will be small compared to the dynamic content...) -klm.
login.pl not sending cookies via POST?
I have tried two different Apache::AuthCookie subclasses: Apache::AuthTicket 0.31 Apache::AuthCookieDBI 1.18 Apache::AuthCookie comes with an example login.pl, as well as does Apache::AuthCookieDBI. The symptom I was seeing: my browser would submit the form generated by login.pl: [Wed May 22 17:05:45 2002] [error] auth_type Apache::AuthTicket [Wed May 22 17:05:45 2002] [error] auth_name CredTest [Wed May 22 17:05:45 2002] [error] ses_key_cookie [Wed May 22 17:05:45 2002] [error] uri /credentials/private/index.html I was verifing via tcpdump that my browser was sending the data via POST. I could now wait forever, until the connection gets reset. However, if I got impatient, and terminated the request, I'd then see only then that the Apache::AuthTicket handler was getting my data: [Wed May 22 17:05:49 2002] [error] credential_0 foo [Wed May 22 17:05:49 2002] [error] credential_1 bar [Wed May 22 17:05:49 2002] [error] ses_key expires:1022102449:hash:68938c9521597c10fe1d165780b032fd:version:1:time:1022101549:user:foo It turns out both of these example scripts use a 'POST' method; if I change that to a 'GET' method, Apache::AuthTicket works out-of-the-box. (I haven't re-tested Apache::AuthCookieDBI.) I have no idea why POST _doesn't_ work, mind you... Just an FYI to the public at large... (Just wasted a day chasing crap with tcpdump, trying to track this one down...) -- Brian 'you Bastard' Reichert[EMAIL PROTECTED] 37 Crystal Ave. #303Daytime number: (603) 434-6842 Derry NH 03038-1713 USA Intel architecture: the left-hand path
Re: How to proxy everything except selected urls?
Ken == Ken Miller [EMAIL PROTECTED] writes: Ken I initially thought something like this would work: Ken --- Ken ProxyPass On Ken ProxyPass / http://other.server.com:1234/ Ken ProxyPassReverse / http://other.server.com:1234/ Ken alias /graphics /local/path Ken --- Ken However, /graphics also get's proxied to the app server. This isn't what I Ken want. Ken I don't think mod_proxy can do this; at least it's not clear to me how to if Ken it does support this feature. Ken Would mod_rewrite be a better solution? Match on the URL's that I want Ken processed locally (and stop), else map the url to the app server, and Ken forward the request? Here's what the reverse-caching-proxy front end for www.stonehenge.com uses: RewriteEngine On ## RewriteLog /web/stonehenge-proxy/var/log/rewrite_log ## RewriteLogLevel 3 ## local services: RewriteRule ^/icons/ - [last] RewriteRule ^/tt2/images/ - [last] ## local redirect: RewriteRule ^/cgi/go/(.*)$ $1 [redirect,last,noescape] ## passthrough: RewriteMap escape int:escape RewriteRule ^/(.*)$ http://localhost:8081/${escape:$1} [proxy,noescape] ProxyPassReverse / http://localhost:8081/ ## made a mistake! should never get here RewriteRule .* - [forbidden] By the way, without that RewriteMap, %3F in a URL incorrectly becomes ?, thus ending the path-part and begins the query-part. Bad. Broken. But this workaround works fine. And the examples in the mod_rewrite documentation are wrong. I figured this out while rebuilding http://www.stonehenge.com/merlyn/Pictures/ to work with images that had spaces in the filenames as well as question marks and ampersands. :) Talk about escaping hell. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 [EMAIL PROTECTED] URL:http://www.stonehenge.com/merlyn/ Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Re: How to proxy everything except selected urls?
Ken Miller wrote: I the past, when I've setup a proxy/app server configuration, it's always been to forward certain url's to the app server, with the rest being processed by the proxy. However, I need to turn this around. I want to pass everything to the app server, except for some url's that point at static content (images, mostly). I initially thought something like this would work: --- ProxyPass On ProxyPass / http://other.server.com:1234/ ProxyPassReverse / http://other.server.com:1234/ alias /graphics /local/path --- However, /graphics also get's proxied to the app server. This isn't what I want. I actually have had to do this myself... The solution is as follows: ProxyPass/staticstuff/! ProxyPass/ http://other.host/ ProxyPassReverse / http://other.host/ ! is a special symbol telling it not to proxy that stuff - also, I think order counts (eg, do !s first) Issac Issac
Cannot build mod_perl 2 on Win32: Linking problems
I have Apache/2.0.36 mod_perl/1.99_02-dev Perl/v5.7.3 and am using nmake. Apache2 is installed (and working) in C:\Apache2\bin I built both perl and Apache from sources. My makefile.pl command line is: perl makefile.pl MP_AP_PREFIX=C:\Apache2 I'm getting numerous linking problems, e.g.: mod_perl.lo : error LNK2001: unresolved external symbol __imp__exit The unresolved links are to Microsoft libs, Kernel32.lib, etc. My LIB environment variable looks OK, though. What should I do? I could add all the libs, but I'm sure there is a simpler problem. Cannot find anything in the existing archives of the mailing lists. Thanks for any help. Joe Yates
Apache::DBI connection cache
Apache::DBI is turning the argument hashref into the cache key with the following code, my ($key, $val); while (($key,$val) = each %{$args[3]}) { $Idx .= $;$key=$val; } can anyone think of a good reason not to change that to something like map { $Idx .= $;$_=$args[3]-{$_} } sort keys %{$args[3]}; (or a similar for loop) (My problem, obviously, was that Apache::DBI got several connections to the same database with the same args; but the hash had the args ordered in a different way.) - ask -- ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
Re: Apache::DBI connection cache
Ask Bjoern Hansen wrote: Apache::DBI is turning the argument hashref into the cache key with the following code, my ($key, $val); while (($key,$val) = each %{$args[3]}) { $Idx .= $;$key=$val; } can anyone think of a good reason not to change that to something like map { $Idx .= $;$_=$args[3]-{$_} } sort keys %{$args[3]}; Good find. That's a bug. Fix it. - Perrin
Re: Apache::DBI connection cache
On Wed, 22 May 2002, Perrin Harkins wrote: Apache::DBI is turning the argument hashref into the cache key with the following code, [...] can anyone think of a good reason not to change that to something like map { $Idx .= $;$_=$args[3]-{$_} } sort keys %{$args[3]}; Good find. That's a bug. Fix it. I sent a patch to Edmund. - ask -- ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
Re: #perl SSI directive not recognised
On Wed, 22 May 2002, Alan Burlison wrote: I have another little problem I'm trying solve, which will be really neat if I can get it to work. You may or may not know that Solaris has a fair share scheduler, which means you can limit the total proportion of CPU that a particular user can use. nice. I want Apache to switch into a resource-managed Project at startup, but to do so I need to find out the value of the User parameter in httpd.conf, and I can't find a way to do this - is there one? Apache::Server::uid returns the uid of the configured User. you can access via: Apache-server-uid at startup time or $r-server-uid at request time
Re: Apache::DBI connection cache
Ask Bjoern Hansen wrote: Apache::DBI is turning the argument hashref into the cache key with the following code, my ($key, $val); while (($key,$val) = each %{$args[3]}) { $Idx .= $;$key=$val; } can anyone think of a good reason not to change that to something like map { $Idx .= $;$_=$args[3]-{$_} } sort keys %{$args[3]}; (or a similar for loop) (My problem, obviously, was that Apache::DBI got several connections to the same database with the same args; but the hash had the args ordered in a different way.) FWIW, this code was borrowed right from DBI (at least I think it was). see the very end of Tim's recent (5/1/2002) message here http:[EMAIL PROTECTED]/msg11273.html to see how DBI connect_cached() now handles it (and Tim's suggested change to Apache::DBI). HTH --Geoff
Re: What causes memory leaks during graceful restarts?
On Wed, 22 May 2002, Dan Wilga wrote: Oh ho! That's it. Now when I gracefully restart, the memory loss is only about 29 Kb -- a very reasonable number. much better. with the modperl test suite, i only see a wee bit of leakage on the first restart, then no leakage on restarts after that. So if that's the reason for the core dump, is there a bug fix to the offending module in the works? it is fixed in 5.8.0-tobe with the patch below, which can also be applied to 5.6.1 Index: ext/DynaLoader/DynaLoader_pm.PL === RCS file: /usr/local/cvs_repository/perl-current-mirror/ext/DynaLoader/DynaLoader_pm.PL,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 DynaLoader_pm.PL --- ext/DynaLoader/DynaLoader_pm.PL 2001/01/04 01:55:35 1.1.1.1 +++ ext/DynaLoader/DynaLoader_pm.PL 2001/06/19 05:10:22 -80,8 +80,10 dl_require_symbols = (); # names of symbols we need dl_resolve_using = (); # names of files to link with dl_library_path= (); # path to look for files -@dl_librefs = (); # things we have loaded -@dl_modules = (); # Modules we have loaded + +#XSLoader.pm may have added elements before we were required +#@dl_librefs = (); # things we have loaded +#@dl_modules = (); # Modules we have loaded # This is a fix to support DLD's unfortunate desire to relink -lc dl_resolve_using = dl_findfile('-lc') if $dlsrc eq dl_dld.xs;
Re: Cannot build mod_perl 2 on Win32: Linking problems
On Thu, 23 May 2002, Joe Yates wrote: Perl/v5.7.3 what does your perl -V say ? never tried the released version of 5.7.3 on win32, but i've been rsync-ing perl-current which compiles/links and passes all test. rsync.exe -auvz --delete rsync://ftp.linux.activestate.com/perl-current/ perl-current
Re: compatibility problem
On Mon, 20 May 2002, Doug MacEachern wrote: On Fri, 17 May 2002, Jie Gao wrote: use Apache::Constants qw(:common :response M_GET M_POST AUTH_REQUIRED REDIRECT); the :response group in 1.x consists of names which apache has deprecated in 1.3.x and removed in 2.0, for which there are HTTP_* names that replace the old names. so for example, if you had imported the :response group to use 'BAD_GATEWAY', you should instead explicity import HTTP_BAD_GATEWAY, which will work with both 1.x and 2.x. I put this in my module: use Apache::Constants qw(:common BAD_GATEWAY M_GET M_POST AUTH_REQUIRED REDIRECT FORBIDDEN SERVER_ERROR); and make test says BAD_GATEWAY is not exported by Apache::Constants. Also perl-status doesn't seem to be functioning: [Thu May 23 14:14:43 2002] [error] [client 129.xx.xx.xx] Undefined subroutine Apache::Constants::SERVER_VERSION called at /usr/lib/perl5/site_perl/5.6.1/i386-linux/Apache/Status.pm line 86. I am also getting: [Thu May 23 14:11:45 2002] [notice] child pid 32213 exit signal Segmentation fault (11) when running my 1.3 module. I couldn't find any coredump, though. Anyone can help? Regards, Jie
Re: Patch to mod_perl 1.26: error-notes support
thanks, i've applied a variation of your patch to cvs and will be in 1.27 if anybody wants to work up a similar patch for Apache::PerlRun, that'd be nice too. On Fri, 12 Apr 2002, Jesse Erlbaum wrote: Hello Doug All -- One of my programmers (Dave Kaufman) brought to my attention a small but useful feature which is present in mod_cgi, but missing from Apache::Registry. When running via mod_cgi, if execution of a CGI application fails, an error message will be propagated to an environment variable, ERROR_NOTES. This environment variable can be used by a custom ErrorDocument to assist in quality assurance. This variable is actually propagated, by http_request.c (confirmed in Apache 1.3.20), from an Apache note whose key is error-notes. A number of Apache handlers use the error-notes attribute to pass along human-readable exception data. Following is a patch I wrote (against mod_perl 1.26, Apache::Registry version 2.01) which causes Apache::Registry to participate in this scheme. I hope you find it sufficiently useful to include in the next version of mod_perl. Warmest regards, -Jesse- START PATCH diff -c -r1.1 Registry.pm *** modules/i686-linux/Apache/Registry.pm 13 Mar 2002 18:06:34 - 1.1 --- modules/i686-linux/Apache/Registry.pm 22 Mar 2002 22:19:10 - *** *** 129,134 --- 129,135 if ($@) { $r-log_error($@); $@{$uri} = $@; + $r-notes('error-notes', $@); return SERVER_ERROR unless $Debug $Debug 2; return Apache::Debug::dump($r, SERVER_ERROR); } *** *** 153,158 --- 154,160 if($errsv) { $r-log_error($errsv); + $r-notes('error-notes', $errsv); return SERVER_ERROR unless $Debug $Debug 2; return Apache::Debug::dump($r, SERVER_ERROR); } END PATCH Jesse Erlbaum, CTO Vanguard Media http://www.vm.com 212.242.5317 x115 [EMAIL PROTECTED]
Re: compatibility problem
On Thu, 23 May 2002, Jie Gao wrote: and make test says BAD_GATEWAY is not exported by Apache::Constants. are you actually using that constant? i only was using it as an example. Also perl-status doesn't seem to be functioning: Apache::Status doesn't work with 2.0 yet. I am also getting: [Thu May 23 14:11:45 2002] [notice] child pid 32213 exit signal Segmentation fault (11) when running my 1.3 module. I couldn't find any coredump, though. Anyone can help? modperl-1.xx/SUPPORT: % gdb ../apache_x.xx/src/httpd (gdb) run -X -f `pwd`/t/conf/httpd.conf -d `pwd`/t [now make request that causes core dump] (gdb) bt
Re: compatibility problem
On Wed, 22 May 2002, Doug MacEachern wrote: On Thu, 23 May 2002, Jie Gao wrote: and make test says BAD_GATEWAY is not exported by Apache::Constants. are you actually using that constant? i only was using it as an example. if you are, you need to change it to HTTP_BAD_GATEWAY. one caveat for 1.x compat, not all of the Apache::Constants are in EXPORT/EXPORT_OK in 1.x. reason is because Exporter.pm is such a memory hog, we tried to limit the number of exports. this particular HTTP_ constant is one that was left out of the default list. it is however available if you export it in 1.x. to do this you need to call: Apache::Constants-export(qw(HTTP_BAD_GATEWAY)); i just added a stub to Apache::compat to provide that method (which does nothing). all constants are available for import in 2.0 since we no longer use Exporter.pm
Re: compatibility problem
On Wed, 22 May 2002, Doug MacEachern wrote: Apache::Status doesn't work with 2.0 yet. actually, it kinda does after added SERVER_VERSION to Apache::compat. Enabled mod_perl Hooks does not work, nor does Compiled Registry Scripts, but everything else seems to.
Re: compatibility problem
On Wed, 22 May 2002, Doug MacEachern wrote: On Thu, 23 May 2002, Jie Gao wrote: I am also getting: [Thu May 23 14:11:45 2002] [notice] child pid 32213 exit signal Segmentation fault (11) when running my 1.3 module. I couldn't find any coredump, though. Anyone can help? modperl-1.xx/SUPPORT: % gdb ../apache_x.xx/src/httpd (gdb) run -X -f `pwd`/t/conf/httpd.conf -d `pwd`/t [now make request that causes core dump] (gdb) bt OK, here you are: (gdb) run -X -f /usr/local/apache2/conf/httpd.conf -d /usr/local/apache2 Starting program: /usr/local/apache2/bin/httpd -X -f /usr/local/apache2/conf/httpd.conf -d /usr/local/apache2 [New Thread 1024 (LWP 15349)] bt Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1024 (LWP 15349)] 0x4031575d in modperl_mgv_lookup (symbol=0x0) at modperl_mgv.c:134 134 if (!symbol-hash) { (gdb) bt #0 0x4031575d in modperl_mgv_lookup (symbol=0x0) at modperl_mgv.c:134 #1 0x403103ed in modperl_callback (handler=0x83dcd68, p=0x83d3438, r=0x83d3470, s=0x80d1540, args=0x8131110) at modperl_callback.c:19 #2 0x40310aec in modperl_callback_run_handlers (idx=2, type=5, r=0x83d3470, c=0x0, s=0x80d1540, pconf=0x0, plog=0x0, ptemp=0x0) at modperl_callback.c:175 #3 0x40310b9a in modperl_callback_per_dir (idx=2, r=0x83d3470) at modperl_callback.c:199 #4 0x403186f0 in modperl_authen_handler (r=0x83d3470) at modperl_hooks.c:42 #5 0x0807734a in ap_run_check_user_id (r=0x83d3470) at request.c:111 #6 0x08077b31 in ap_process_request_internal (r=0x83d3470) at request.c:220 #7 0x08064715 in ap_process_request (r=0x83d3470) at http_request.c:259 #8 0x08060c4d in ap_process_http_connection (c=0x83cd528) at http_core.c:291 #9 0x0806e3e2 in ap_run_process_connection (c=0x83cd528) at connection.c:85 #10 0x08065a85 in child_main (child_num_arg=0) at prefork.c:671 #11 0x08065b38 in make_child (s=0x8098790, slot=0) at prefork.c:711 #12 0x08065c22 in startup_children (number_to_start=10) at prefork.c:783 #13 0x08065f24 in ap_mpm_run (_pconf=0x8096a40, plog=0x80c0ae8, s=0x8098790) at prefork.c:999 #14 0x0806ac0f in main (argc=6, argv=0xb944) at main.c:632 #15 0x40109647 in __libc_start_main (main=0x806a500 main, argc=6, ubp_av=0xb944, init=0x805e6c4 _init, fini=0x80802a0 _fini, rtld_fini=0x4000dcd4 _dl_fini, stack_end=0xb93c) at ../sysdeps/generic/libc-start.c:129 (gdb) Subsequent requests hang. Regards, Jie
Re: DSO on Solaris - child dies with seg fault
On Sun, 14 Apr 2002, Sreeji K Das wrote: Hi Stas, Thanx for the reply. However, I had already read the doc. and done everything mentioned there. I had recompiled perl with -Ubincompat5005 as mentioned. wondering if this is the XSLoader vs DynaLoader mentioned earlier today. there is a workaround builtin to 1.27-tobe: http://perl.apache.org/~dougm/mod_perl-1.26_01-dev.tar.gz you could also try 'use DynaLoader ();' before loading any other modules.
Re: compatibility problem
On Thu, 23 May 2002, Jie Gao wrote: Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 1024 (LWP 15349)] 0x4031575d in modperl_mgv_lookup (symbol=0x0) at modperl_mgv.c:134 134 if (!symbol-hash) { (gdb) bt #0 0x4031575d in modperl_mgv_lookup (symbol=0x0) at modperl_mgv.c:134 #1 0x403103ed in modperl_callback (handler=0x83dcd68, p=0x83d3438, r=0x83d3470, s=0x80d1540, args=0x8131110) at modperl_callback.c:19 this is with modperl-2.0 from cvs? if you have a simple test case to reproduce, that would help. looks related to method handlers based on your stacktrace.
cvs commit: modperl/lib/Apache ExtUtils.pm
dougm 02/05/22 19:44:40 Modified:.Makefile.PL lib/Apache ExtUtils.pm Log: on hpux with bleedperl $Config{ld} is the fullpath, strip to the basename Revision ChangesPath 1.200 +4 -2 modperl/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl/Makefile.PL,v retrieving revision 1.199 retrieving revision 1.200 diff -u -r1.199 -r1.200 --- Makefile.PL 24 Mar 2002 19:06:03 - 1.199 +++ Makefile.PL 23 May 2002 02:44:40 - 1.200 -19,7 +19,7 use FileHandle (); use DirHandle (); use File::Compare (); -use File::Basename qw(dirname); +use File::Basename qw(dirname basename); use File::Path qw(mkpath rmtree); use Cwd; use File::Copy qw(cp); -2398,7 +2398,9 } } -if ($^O eq 'hpux' and ($USE_DSO or $USE_APXS) and $Config{ld} eq 'ld') { +my $ld = basename $Config{ld}; + +if ($^O eq 'hpux' and ($USE_DSO or $USE_APXS) and $ld eq 'ld') { unless ($ccflags =~ /\+z/i) { my $switch = $] = 5.006 ? 'A' : 'D'; phat_warn(EOF); 1.25 +2 -0 modperl/lib/Apache/ExtUtils.pm Index: ExtUtils.pm === RCS file: /home/cvs/modperl/lib/Apache/ExtUtils.pm,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- ExtUtils.pm 24 Mar 2002 19:06:03 - 1.24 +++ ExtUtils.pm 23 May 2002 02:44:40 - 1.25 -4,6 +4,7 use Exporter (); use IO::File (); use File::Copy (); +use File::Basename qw(basename); $Apache::ExtUtils::VERSION = '1.04'; -35,6 +36,7 sub Config_pm_fixup { eval { require Apache::MyConfig; }; my %config_fixups = ( + ld = sub { s/(.*)/basename $1/e }, ccdlflags = sub { s/-R\s+/-R/; }, ccflags = sub { s/-D_GNU_SOURCE//;
cvs commit: modperl Changes Makefile.PL
dougm 02/05/22 19:52:15 Modified:.Changes Makefile.PL Log: autoset PERL_USELARGEFILES=0 if needed Revision ChangesPath 1.642 +2 -0 modperl/Changes Index: Changes === RCS file: /home/cvs/modperl/Changes,v retrieving revision 1.641 retrieving revision 1.642 diff -u -r1.641 -r1.642 --- Changes 16 Apr 2002 02:43:55 - 1.641 +++ Changes 23 May 2002 02:52:15 - 1.642 -10,6 +10,8 =item 1.26_01-dev +autoset PERL_USELARGEFILES=0 if needed + fix taint issues with bleedperl fix bug in modules/util test 1.201 +10 -7 modperl/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl/Makefile.PL,v retrieving revision 1.200 retrieving revision 1.201 diff -u -r1.200 -r1.201 --- Makefile.PL 23 May 2002 02:44:40 - 1.200 +++ Makefile.PL 23 May 2002 02:52:15 - 1.201 -382,13 +382,6 $PERL_EXTRA_CFLAGS .= -DPERL_SAFE_STARTUP=1; } -if ($PERL_USELARGEFILES and $] = 5.006) { -$PERL_EXTRA_CFLAGS .= $Config{ccflags}; -} - -# apache-1.3.xx won't compile with -D_GNU_SOURCE -$PERL_EXTRA_CFLAGS =~ s/-D_GNU_SOURCE//; - for (keys %PassEnv) { $ENV{$_} = $$_ if $$_; } -430,6 +423,13 system_sanity_check(); +if ($PERL_USELARGEFILES and $] = 5.006) { +$PERL_EXTRA_CFLAGS .= $Config{ccflags}; +} + +# apache-1.3.xx won't compile with -D_GNU_SOURCE +$PERL_EXTRA_CFLAGS =~ s/-D_GNU_SOURCE//; + if ($USE_APACI) { print Will configure via APACI; if($USE_DSO) { -2459,6 +2459,9 local $Apache::src::APXS = $WITH_APXS; my $cflags = Apache::src-new-apxs('-q' = 'CFLAGS') || ''; return if $cflags =~ /LARGEFILE/; + +$PERL_USELARGEFILES=0; #just do it since +return; #nobody seems to listen to the warning below phat_warn(EOF); Your Perl is uselargefiles enabled, but Apache is not, suggestions:
cvs commit: modperl/t/docs startup.pl
dougm 02/05/22 20:07:28 Modified:.Changes src/modules/perl mod_perl.h t/docs startup.pl Log: make sure DynaLoader is loaded before XSLoader to workaround possible segv when using mod_perl as a dso with perl 5.6.1 Revision ChangesPath 1.643 +3 -0 modperl/Changes Index: Changes === RCS file: /home/cvs/modperl/Changes,v retrieving revision 1.642 retrieving revision 1.643 diff -u -r1.642 -r1.643 --- Changes 23 May 2002 02:52:15 - 1.642 +++ Changes 23 May 2002 03:07:27 - 1.643 -10,6 +10,9 =item 1.26_01-dev +make sure DynaLoader is loaded before XSLoader to workaround possible +segv when using mod_perl as a dso with perl 5.6.1 + autoset PERL_USELARGEFILES=0 if needed fix taint issues with bleedperl 1.114 +1 -0 modperl/src/modules/perl/mod_perl.h Index: mod_perl.h === RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.h,v retrieving revision 1.113 retrieving revision 1.114 diff -u -r1.113 -r1.114 --- mod_perl.h24 Mar 2002 23:01:33 - 1.113 +++ mod_perl.h23 May 2002 03:07:27 - 1.114 -1192,6 +1192,7 /* perl_config.c */ #define require_Apache(s) \ +perl_require_module(DynaLoader, s); \ perl_require_module(Apache, s) char *mod_perl_auth_name(request_rec *r, char *val); 1.44 +1 -0 modperl/t/docs/startup.pl Index: startup.pl === RCS file: /home/cvs/modperl/t/docs/startup.pl,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- startup.pl15 May 2002 18:01:21 - 1.43 +++ startup.pl23 May 2002 03:07:27 - 1.44 -25,6 +25,7 }; $@='' if $; } +use Socket (); #test DynaLoader vs. XSLoader workaroud use Apache (); use Apache::Registry (); unless ($INC{'Apache.pm'} =~ /blib/) {
cvs commit: modperl/apaci mod_perl.config.sh
dougm 02/05/22 20:30:21 Modified:apacimod_perl.config.sh Log: another bleedperl/hpux/ld hack Revision ChangesPath 1.26 +1 -1 modperl/apaci/mod_perl.config.sh Index: mod_perl.config.sh === RCS file: /home/cvs/modperl/apaci/mod_perl.config.sh,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- mod_perl.config.sh6 Jul 2001 20:08:36 - 1.25 +++ mod_perl.config.sh23 May 2002 03:30:21 - 1.26 -145,7 +145,7 $ldopts =~ s,(-bE:)(perl\.exp),$1$Config{archlibexp}/CORE/$2, if($^O eq aix); #replace -Wl args meant for cc with args for ld -if ($ARGV[0] eq DSO and $^O eq hpux and $Config{ld} eq ld) { +if ($ARGV[0] eq DSO and $^O eq hpux and $Config{ld} =~ /ld$/) { while ($ldopts =~ s/-Wl,(\S+)/$1/) { my $cp = $1; (my $repl = $cp) =~ s/,/ /g;
cvs commit: modperl Changes Makefile.PL STATUS
dougm 02/05/22 20:38:39 Modified:.Changes Makefile.PL STATUS Log: Submitted by: Randy Kobes [EMAIL PROTECTED] Reviewed by: dougm fix Win32 build problems with spaces in shell arguments Revision ChangesPath 1.644 +3 -0 modperl/Changes Index: Changes === RCS file: /home/cvs/modperl/Changes,v retrieving revision 1.643 retrieving revision 1.644 diff -u -r1.643 -r1.644 --- Changes 23 May 2002 03:07:27 - 1.643 +++ Changes 23 May 2002 03:38:39 - 1.644 @@ -10,6 +10,9 @@ =item 1.26_01-dev +fix Win32 build problems with spaces in shell arguments +[Randy Kobes [EMAIL PROTECTED]] + make sure DynaLoader is loaded before XSLoader to workaround possible segv when using mod_perl as a dso with perl 5.6.1 1.202 +1 -1 modperl/Makefile.PL Index: Makefile.PL === RCS file: /home/cvs/modperl/Makefile.PL,v retrieving revision 1.201 retrieving revision 1.202 diff -u -r1.201 -r1.202 --- Makefile.PL 23 May 2002 02:52:15 - 1.201 +++ Makefile.PL 23 May 2002 03:38:39 - 1.202 @@ -1104,7 +1104,7 @@ cp lib/mod_perl_hooks.pm.PL, lib/mod_perl_hooks.pm; if ($Is_Win32) { - my @args = ($^X, '-spi.bak ', ' -e ', \s/sub mod_perl::hooks.*/sub mod_perl::hooks { qw($hooks) }/\, 'lib/mod_perl_hooks.pm'); + my @args = ($^X, '-spi.bak', '-e', \s/sub mod_perl::hooks.*/sub mod_perl::hooks { qw($hooks) }/\, 'lib/mod_perl_hooks.pm'); system(@args) == 0 or die @args failed\n; } iedit lib/mod_perl_hooks.pm, 1.19 +1 -7 modperl/STATUS Index: STATUS === RCS file: /home/cvs/modperl/STATUS,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- STATUS14 May 2002 18:05:34 - 1.18 +++ STATUS23 May 2002 03:38:39 - 1.19 @@ -1,5 +1,5 @@ mod_perl 1.3 STATUS: - Last modified at [$Date: 2002/05/14 18:05:34 $] + Last modified at [$Date: 2002/05/23 03:38:39 $] Release: @@ -9,12 +9,6 @@ Available Patches: - -* Win32 build problems with spaces in shell arguments -Report: http://marc.theaimsgroup.com/?l=apache-modperlm=101681938513575w=2 - Status: - patch available at - http://marc.theaimsgroup.com/?l=apache-modperlm=101729204503165w=2 * implement notes('error-notes') in Registry a la mod_cgo Report: http://marc.theaimsgroup.com/?l=apache-modperlm=101862462900504w=2
cvs commit: modperl/src/modules/perl mod_perl.c mod_perl.h
dougm 02/05/22 21:03:46 Modified:src/modules/perl mod_perl.c mod_perl.h Log: better fix for DynaLoader vs XSLoader workaround Revision ChangesPath 1.144 +23 -1 modperl/src/modules/perl/mod_perl.c Index: mod_perl.c === RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.c,v retrieving revision 1.143 retrieving revision 1.144 diff -u -r1.143 -r1.144 --- mod_perl.c24 Mar 2002 23:01:33 - 1.143 +++ mod_perl.c23 May 2002 04:03:46 - 1.144 -569,6 +569,28 perl_startup(s, p); } +static void mod_perl_boot(void *data) +{ +/* make sure DynaLoader is loaded before XSLoader + * to workaround bug in 5.6.1 that can trigger a segv + * when using modperl as a dso + */ +perl_require_module(DynaLoader, NULL); +} + +static void mod_perl_xs_init(void) +{ +xs_init(); + +/* XXX: in 5.7.2+ we can call the body of mod_perl_boot here + * but in 5.6.1 the Perl runtime is not properly setup yet + * so we have to pull this stunt to delay + */ +#ifdef SAVEDESTRUCTOR_X +SAVEDESTRUCTOR_X(mod_perl_boot, 0); +#endif +} + void perl_startup (server_rec *s, pool *p) { char *argv[] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL }; -677,7 +699,7 MP_TRACE_g(fprintf(stderr, constructing perl interpreter...ok\n)); perl_construct(perl); -status = perl_parse(perl, xs_init, argc, argv, NULL); +status = perl_parse(perl, mod_perl_xs_init, argc, argv, NULL); if (status != OK) { MP_TRACE_g(fprintf(stderr,not ok, status=%d\n, status)); perror(parse); 1.115 +0 -1 modperl/src/modules/perl/mod_perl.h Index: mod_perl.h === RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.h,v retrieving revision 1.114 retrieving revision 1.115 diff -u -r1.114 -r1.115 --- mod_perl.h23 May 2002 03:07:27 - 1.114 +++ mod_perl.h23 May 2002 04:03:46 - 1.115 -1192,7 +1192,6 /* perl_config.c */ #define require_Apache(s) \ -perl_require_module(DynaLoader, s); \ perl_require_module(Apache, s) char *mod_perl_auth_name(request_rec *r, char *val);
cvs commit: modperl/t/net/perl server_error.pl
dougm 02/05/22 21:21:07 Modified:.Changes STATUS lib/Apache Registry.pm t/net/perl server_error.pl Log: Submitted by: Jesse Erlbaum [EMAIL PROTECTED] Reviewed by: dougm Apache::Registry errors are now saved in $r-notes('error-notes') Revision ChangesPath 1.645 +3 -0 modperl/Changes Index: Changes === RCS file: /home/cvs/modperl/Changes,v retrieving revision 1.644 retrieving revision 1.645 diff -u -r1.644 -r1.645 --- Changes 23 May 2002 03:38:39 - 1.644 +++ Changes 23 May 2002 04:21:06 - 1.645 @@ -10,6 +10,9 @@ =item 1.26_01-dev +Apache::Registry errors are now saved in $r-notes('error-notes') +[Jesse Erlbaum [EMAIL PROTECTED]] + fix Win32 build problems with spaces in shell arguments [Randy Kobes [EMAIL PROTECTED]] 1.20 +1 -10 modperl/STATUS Index: STATUS === RCS file: /home/cvs/modperl/STATUS,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- STATUS23 May 2002 03:38:39 - 1.19 +++ STATUS23 May 2002 04:21:06 - 1.20 @@ -1,5 +1,5 @@ mod_perl 1.3 STATUS: - Last modified at [$Date: 2002/05/23 03:38:39 $] + Last modified at [$Date: 2002/05/23 04:21:06 $] Release: @@ -9,15 +9,6 @@ Available Patches: - -* implement notes('error-notes') in Registry a la mod_cgo -Report: http://marc.theaimsgroup.com/?l=apache-modperlm=101862462900504w=2 - Status: - I haven't had the chance to investigate this thoroughly, but - mod_perl does seem to be setting error-notes for some things. maybe - just not enough things or Registry specific things? --Geoff - patch available at - http://marc.theaimsgroup.com/?l=apache-modperlm=101862462900504w=2 * Apache::Status allows standard keys to be overridden Report: http://marc.theaimsgroup.com/?l=apache-modperlm=101559176217056w=2 1.34 +10 -4 modperl/lib/Apache/Registry.pm Index: Registry.pm === RCS file: /home/cvs/modperl/lib/Apache/Registry.pm,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- Registry.pm 28 Sep 2000 16:35:53 - 1.33 +++ Registry.pm 23 May 2002 04:21:07 - 1.34 @@ -24,6 +24,13 @@ $Apache::Registry::MarkLine = 1; } +sub xlog_error { +my($r, $msg) = @_; +$r-log_error($msg); +$r-notes('error-notes', $msg); +$@{$r-uri} = $msg; +} + sub handler { my $r = shift; if(ref $r) { @@ -127,8 +134,7 @@ compile($eval); $r-stash_rgy_endav($script_name); if ($@) { - $r-log_error($@); - $@{$uri} = $@; + xlog_error($r, $@); return SERVER_ERROR unless $Debug $Debug 2; return Apache::Debug::dump($r, SERVER_ERROR); } @@ -152,7 +158,7 @@ } if($errsv) { - $r-log_error($errsv); + xlog_error($r, $errsv); return SERVER_ERROR unless $Debug $Debug 2; return Apache::Debug::dump($r, SERVER_ERROR); } @@ -165,7 +171,7 @@ #} return $r-status($old_status); } else { -$r-log_error($filename not found or unable to stat); +xlog_error($r, $filename not found or unable to stat); return NOT_FOUND unless $Debug $Debug 2; return Apache::Debug::dump($r, NOT_FOUND); } 1.2 +11 -2 modperl/t/net/perl/server_error.pl Index: server_error.pl === RCS file: /home/cvs/modperl/t/net/perl/server_error.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- server_error.pl 19 Mar 1998 23:09:06 - 1.1 +++ server_error.pl 23 May 2002 04:21:07 - 1.2 @@ -2,9 +2,18 @@ $r-send_http_header(text/plain); -print ServerError:\n; +my $err = $@{$r-prev-uri}; -print $@{$r-prev-uri}; +my $note = $r-prev-notes('error-notes') || 'NONE'; + +print ServerError: $err\n; + +if ($note eq $err) { +print error-notes is also set; +} +else { +print error-notes is different: $note; +} print \n; print 'dump of %@:', \n;
cvs commit: modperl/src/modules/perl mod_perl.c mod_perl.h
dougm 02/05/22 21:35:16 Modified:src/modules/perl mod_perl.c mod_perl.h Log: fix fix to compile with ithreads Revision ChangesPath 1.145 +2 -2 modperl/src/modules/perl/mod_perl.c Index: mod_perl.c === RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.c,v retrieving revision 1.144 retrieving revision 1.145 diff -u -r1.144 -r1.145 --- mod_perl.c23 May 2002 04:03:46 - 1.144 +++ mod_perl.c23 May 2002 04:35:16 - 1.145 -578,9 +578,9 perl_require_module(DynaLoader, NULL); } -static void mod_perl_xs_init(void) +static void mod_perl_xs_init(pTHX) { -xs_init(); +xs_init(aTHX); /* XXX: in 5.7.2+ we can call the body of mod_perl_boot here * but in 5.6.1 the Perl runtime is not properly setup yet 1.116 +2 -0 modperl/src/modules/perl/mod_perl.h Index: mod_perl.h === RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.h,v retrieving revision 1.115 retrieving revision 1.116 diff -u -r1.115 -r1.116 --- mod_perl.h23 May 2002 04:03:46 - 1.115 +++ mod_perl.h23 May 2002 04:35:16 - 1.116 -168,6 +168,8 #ifndef PERL_IS_5_6 #define pTHX_ #define aTHXo_ +#define aTHX +#define pTHX #define CopFILEGV(cop) cop-cop_filegv #define CopLINE(cop) cop-cop_line #define CopLINE_set(c,l) (CopLINE(c) = (l))