Re: caching questions
Sorry to step in here, but could I use any of the caching modules you mentionned in mod_perl2? thx tom Am Mon, 2003-07-21 um 21.45 schrieb Perrin Harkins: On Sun, 2003-07-20 at 15:47, Patrick Galbraith wrote: One thing that my code does is check to see if it's cache has been updated to the db, which I wish I could really have some sort of cache that's in one place in memory (as opposed to each child process). Well, you can't, unless you use threads. I know there's IPC, and also memcached. I've used IPC::Shareable before, but don't know if that's the route I'd wanna go. It's not. IPC::Shareable is very slow. If you want to share data, use Cache::FileCache, Cache::Mmap, MLDBM::Sync, or IPC::MM. Has anyone implemented a good caching system that sets up a global cache that you don't have to check constantly because you happen to have been served out by a child that doesn't have the latest cache from DB? One single memory object? The systems I listed above all use a shared cache that will have the same data regardless of which process accesses it. - Perrin
[Fwd: Call for Participation for ApacheCon US 2003]
FYI: -BEGIN PGP SIGNED MESSAGE- Call for Participation: ApacheCon US 2003 = November 16-19, 2002, Las Vegas, Nevada, US [Please feel free to forward this notice far and wide!] SUBMISSION DEADLINE: Monday, 25 August May 2003, 23:59 EDT Come share your knowledge of Apache software at this educational and fun-filled gathering of Apache users, vendors, and friends. Apache Software Foundation members are designing the technical program for ApacheCon US 2002 that will include over 40 sessions planned. We are particularly interested in session proposals covering: o Apache Web server topics (installation, compilation, configuration, migration, ...) o All Apache Software Foundation projects (Jakarta, mod_perl, Xerces, et cetera) o scripting languages and dynamic content (Java, PHP, Perl, TCL, Python, XML, XSL, etc.) o Security and eCommerce o Performance tuning, load balancing, high availability o tips for writing Apache Web server modules o Technical and non-technical case studies o new Web-related technologies Only educational sessions related to projects of the Apache Software Foundation or the Web in general will be considered (commercial sales or marketing presentation won't be accepted; please contact [EMAIL PROTECTED] if you're interested in giving a vendor presentation). If you would like to be a speaker at the ApacheCon US 2003 event, please go to the ApacheCon Web site, log in, and choose the 'Submit a CFP' option from the list there: http://ApacheCon.Com/html/login.html NOTE: If you were a speaker or delegate at a past ApacheCon, please log in using the email address you used before; this will remember your information and pre-load the CFP form for you. If this is your first time being involved with ApacheCon, please create a new account. ALL SESSIONS WILL BE 50 MINUTES LONG! If you wish to propose a session that will take two consecutive slots, please mention that in the comments section of the CFP form. - -- #kenP-)} Ken Coar, Sanagendamgagwedweinini http://Golux.Com/coar/ Author, developer, opinionist http://Apache-Server.Com/ Millennium hand and shrimp! -BEGIN PGP SIGNATURE- Version: PGPfreeware 6.5.8 for non-commercial use http://www.pgp.com iQCVAwUBPxwvUJrNPMCpn3XdAQESjAP+Ozou5pTexacvHoa3QpDKeHDFV4zbKRwN AB2ECcrlgCw8INxVfhrdiryvJJvS7yaBzXlBgictqCsBp1cLlqs/grMe44bhy4FK BfSVKNm2mp8NK9NTUz0YnQM02UGOlpj/pdwJU7WPQlwk29htdITcz+AyA0zLQ9TZ DlnJiGAHFjw= =c2Wd -END PGP SIGNATURE- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- __ 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: Need help, Global Hash corruption under mod_perl in perl5.8.0!?!
I think you should consider using a system that is actually supported. Embperl, Apache::ASP, Text::Template, and Mason all have similar syntax to ePerl. There are lots of other things on CPAN that might be even closer in syntax, but are not as widely used and well supported. I just can't understand where the Apache::ePerl bug can be -- it so simple and so clear module.. and it worked on older perl! You should go through the change log for Perl 5.8 then, since something that changed between 5.6 and 5.8 must be causing problems for you. where is all community? it's so silent in the conference. what the language perl programmers migrated to? JSP, PHP? :( Are you asking why more people aren't responding to your question? Probably because almost no one uses ePerl any more. Thank you Perrin for you responses! Embperl, Apache::ASP, Text::Template, and Mason (!) all are great, but .. they all great for middle size web sites, not WML WAP, in cases where (some) people prefer php to Perl. I think I should just patch A::Registry with function that converts eperl script to perl script and let eperl live some more time :-) Are you asking why more people aren't responding to your question? Probably because almost no one uses ePerl any more. no, I just looked at number of newbies and posts.. Anyway It helped and I found the bug ;-) -vlad
Re: MP2 Redirection
Jamie Krasnoo wrote: What would be the best way to redirect in MP2? How would I set the Location in the header? not any different from mp1 (assuming that you have been working with mp1 before, but the mp1 documentation and literature can be used as a reference for most mp2 things). something like this? my $r = Apache-request; # docs say $r-header_out and family are now deceased. that's right. And $r-headers_out() is available in mp1 for several years and should be used in mp1 as well to easy the transition. $r-headers_out(Location = '/some/place.html'); return Apache::DECLINED; why DECLINED? just return Apache::OK. I'm also not sure why do you use Apache-request, I assume you are inside a handler, not a registry script. Since if you are inside a registry script you don't need to return anything at all. __ 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: MP2 Redirection
On Tue, 2003-07-22 at 02:50, Stas Bekman wrote: Jamie Krasnoo wrote: What would be the best way to redirect in MP2? How would I set the Location in the header? not any different from mp1 (assuming that you have been working with mp1 before, but the mp1 documentation and literature can be used as a reference for most mp2 things). something like this? my $r = Apache-request; # docs say $r-header_out and family are now deceased. that's right. And $r-headers_out() is available in mp1 for several years and should be used in mp1 as well to easy the transition. $r-headers_out(Location = '/some/place.html'); return Apache::DECLINED; why DECLINED? just return Apache::OK. My mistake, its been a while and I'm just getting back into it. So its like I'm learning everything all over again. You can use OK? The example in the Eagle book uses REDIRECT within a handler for redirection. So I'm assuming it goes the same for MP2. I'm also not sure why do you use Apache-request, I assume you are inside a handler, not a registry script. Since if you are inside a registry script you don't need to return anything at all. I was using Apache-request as an example. I guess it's a poor one. I should have just used 'my $r = shift;' to get the point across. Jamie Krasnoo
Re: Content compression FAQ
On Mon, 21 Jul 2003, Slava Bizyayev wrote: I will patch FAQ with this shortly. Well but what does HTTP/1.1 support mean ? As far as I know the compressing has not any HTTP/1.1 specific features. mod_deflate compresses content using 8K buffer. When the buffer is filled mod_deflate passes the compressed data to Apache. Sorry, I had mixed up with gzipping module of my upcoming lightweight http and reverse-proxy server. mod_deflate does not wait to fill up a whole 8K buffer, it passes the compressed data to Apache as soon as it is available. And also it supports flushing the compressed data as described below. If an upstream module calls ap_bflush() to flush a pending data then mod_deflate asks zlib to flush a compressed stream and then passes a partially filled buffer to Apache. Since flushing a compressed stream descreases a compression ratio so mod_deflate has DeflateIgnoreFlush to ignore the ap_bflush() calls of an upstream module. It can be used for example with Chili!Soft ASP that calls ap_bflush() after any output even after an output of several bytes. Igor Sysoev http://sysoev.ru/en/
Re: MP2 Redirection
On Tue, 2003-07-22 at 03:10, Jamie Krasnoo wrote: On Tue, 2003-07-22 at 02:50, Stas Bekman wrote: Jamie Krasnoo wrote: What would be the best way to redirect in MP2? How would I set the Location in the header? not any different from mp1 (assuming that you have been working with mp1 before, but the mp1 documentation and literature can be used as a reference for most mp2 things). something like this? my $r = Apache-request; # docs say $r-header_out and family are now deceased. that's right. And $r-headers_out() is available in mp1 for several years and should be used in mp1 as well to easy the transition. $r-headers_out(Location = '/some/place.html'); return Apache::DECLINED; why DECLINED? just return Apache::OK. My mistake, its been a while and I'm just getting back into it. So its like I'm learning everything all over again. You can use OK? The example in the Eagle book uses REDIRECT within a handler for redirection. So I'm assuming it goes the same for MP2. I'm also not sure why do you use Apache-request, I assume you are inside a handler, not a registry script. Since if you are inside a registry script you don't need to return anything at all. I was using Apache-request as an example. I guess it's a poor one. I should have just used 'my $r = shift;' to get the point across. I got the redirection to work. However I don't think its working as it should. Nowhere in the docs does it say that you have to load APR::Table with Apache::RequestRec and Apache::RequestIO to have $r-headers_out() to work. Without APR::Table loaded I get the error: [Tue Jul 22 03:56:35 2003] [error] [client 192.168.0.2] Can't locate object method STORE via package APR::Table at /www/web/perl/MyApache/Redirect.pm line 17. Place APR::Table in and the error goes away. Here's a sample script below. Jamie Krasnoo package MyApache::Redirect; use strict; use warnings; use Apache::RequestRec; use Apache::RequestIO; # comment out 'use APR::Table;' to get error, uncomment to make it go # away. # use APR::Table; use Apache::Const -compile = qw(REDIRECT); sub handler { my $r = shift; $r-content_type('text/html'); $r-headers_out-{Location} = 'http://www.yahoo.com/'; return Apache::REDIRECT; } 1;
Apache::UploadMeter
Hi there, I want to use the Apache-UploadMeter. I set my configuration to: -use Apache::UploadMeter;$Apache::UploadMeter::UploadForm='/formtag.htm';$Apache::UploadMeter::UploadScript='/perl/upload.pl';$Apache::UploadMeter::UploadMeter='/meter';$Apache::UploadMeter::DEBUG = 2;Apache::UploadMeter::configure;- The UploadMeter works perfect - but I don´t know how I can catchthe files within upload.plMy Uploadform has 2 Uploadfields (file1 and file2) an some hidden-fields (which I need to know where the files to store)In my upload.pl I have the follwing Code to Test something: -use Apache ();use Apache::Request ();$apr = Apache::Request-new($r);foreach $parm($apr-param){print "-".$parm." : ".$apr-param($parm)."\n";}print "-\n";- The system it´s running on : RedHat 7.3 / Apache 1.3.27 / mod_perl 1.26 / Perl 5.6.1Apache::Request 1.1 / Apache::UploadMeter 0.22 But the only value I get is the "hook_id" and this is a GET value.How can I get the POST values ?I´m on the beginning with mod_perl - the last time I used Perl and the CGI.pm Can someone show me an example of a "upload.pl" where a file is stored on the server please?
RE: templating system opinions (axkit?)
Hi Jesse, -Original Message- From: Jesse Erlbaum [mailto:[EMAIL PROTECTED] Sent: Monday, July 21, 2003 8:50 PM To: 'Patrick Galbraith' Cc: [EMAIL PROTECTED] Subject: RE: templating system opinions (axkit?) Hi Patrick -- I like the idea of XSLT/XML, though I find myself trying to read between the lines of hype vs. something that's actually very useful. I don't know, so I don't have any opinions. I do know I'd like to use XSLT/XML so as to have a project to use it for, hence learn it. It's mostly hype in my experience. And not even very useful hype, like Java or PHP, which are actually real things which people might want to use. XSLT seems to be XML geeks' answer to CSS+templating. As if CSS wasn't very successful, as if the world needed another templating system, XSLT seems to have been invented to take the creative work of designing web sites out of the hands of HTML designers, and put it in the hands of XPath programmers. You know. Programmers who are really good at both creative design and communicating with human beings. Not. Alright, pretty smarmy. But unless you just happen to have thousands of XML documents sitting around on your hard drive, XSLT is a solution in search of a problem. Most of my data is in a RDBMS -- not XML. To enhance the *need* for XSLT, some databases will now return XML. That's an interesting idea. Instead of using a mature language like Perl|Java|PHP, let's use something like XSLT to turn my data into a web page! It's new, shiny, and will solve the problem of TOO MANY people knowing the other aforementioned languages. D'oh! Too cynical? Maybe. The fact that XSLT is still discussed in serious company just bugs me. ;-) Not just that, but what about SOAP... Net RPC... I'd like to know where those fit in as well. Fantastic, useful stuff. I get so tired of Java types talking about how perl is just a scripting language.. it's not an application platform/server like Dynamo/WebSpere/insert $$$ java non-OS app here. I even tried to crack a particular Orielly java book and was turned off on a statement like Perl is good for proto-typing but not a full application server. Yes, there are a lot of prototypes getting millions of pageviews a day and generating signicifican revenue. You hit the nail on the head there: Prototype in Perl, and then just keep using it! A strategy for the NEW New Economy. TTYL, -Jesse- -- Jesse Erlbaum The Erlbaum Group [EMAIL PROTECTED] Phone: 212-684-6161 Fax: 212-684-6226 It's nice to see that I'm not alone ;-) Without trying to start a religious war, I think all the debate can easily slip to: Is XML really useful? I mean besides creating new job positions, new software, new frameworks, new problems to be solved, some overhead over processing simple text files, etc. But I shouldn't go in there... As for Java, unfortunately the Perl community is in my opinion in a no-win situation. I've seen lots of people in managerial positions hardly knowing how to read/write their emails using Outlook, not knowing that Perl even exists, but giving lessons about the Java usefulness; to quote a recent one: You can't survive on the Internet today without Java. There is a technical snobbery that is hard to defeat since snobbery itself is human nature. But what would I know? Quit cheap philosophy and back to work... Lian Sebe, M.Sc. Freelance Analyst-Programmer www.programEz.net I'm not mad. I've been in bad mood for the last 30 years...
Re: MP2 Redirection
Jamie Krasnoo wrote: [...] $r-headers_out(Location = '/some/place.html'); return Apache::DECLINED; why DECLINED? just return Apache::OK. My mistake, its been a while and I'm just getting back into it. So its like I'm learning everything all over again. You can use OK? The example in the Eagle book uses REDIRECT within a handler for redirection. So I'm assuming it goes the same for MP2. You are right, one returns OK if using parsed headers, as in this example: sub handler { my $r = shift; my $location = $r-args; print Location: $location\n\n; Apache::OK; } I got the redirection to work. However I don't think its working as it should. Nowhere in the docs does it say that you have to load APR::Table with Apache::RequestRec and Apache::RequestIO to have $r-headers_out() to work. Without APR::Table loaded I get the error: [Tue Jul 22 03:56:35 2003] [error] [client 192.168.0.2] Can't locate object method STORE via package APR::Table at /www/web/perl/MyApache/Redirect.pm line 17. $r-headers_out returns a tied hash reference, so ones needs to load APR::Table in order to work with this reference. Doc patches are very welcome. __ 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: Apache::UploadMeter
Sven wrote... [snip] - use Apache (); use Apache::Request (); $apr = Apache::Request-new($r); foreach $parm($apr-param){ print -.$parm. : .$apr-param($parm).\n; } print -\n; - First of all, use instance() instead of new(). I believe the documentation for Apache::UploadMeter mentions this. [snip] Can someone show me an example of a upload.pl where a file is stored on the server please? Sure. Here is the response handler for the testbed for Apache::UploadMeter at http://epoch.beamartyr.net/umtest/form.html package ApacheUploadMeterTest; use Apache::Request; use Apache::Constants qw(OK DECLINED); use CGI::Carp qw(fatalsToBrowser); use Data::Dumper; sub handler { my $r=shift; my $q=Apache::Request-instance($r, POST_MAX=2097152); # Actually, the above line doesn't work - POST_MAX will be a parameter to # Apache::UploadMeter in future releases local($|)=1; my $num=0; print PART1; Content-Type: text/html HTML HEAD TITLEApache::UploadMeter Test Module/TITLE /HEAD BODY H1Upload Complete/H1 PART1 foreach my $upload ($q-upload) { $num++; my $name=$upload-name; my $size=$upload-size; my $filename=$upload-filename; my $type=$upload-type; my $info=Dumper($upload-info); my $tempname=$upload-tempname; print EOP UL LIUpload field: $num/LI LIDetected upload field: $name/LI LIDetected filename: $filename ($size bytes)/LI LIReported MIME type: $type/LI LISpool file: $tempname/LI LIOther debug info: $info/LI /UL EOP } print /BODY/HTML\n; return OK; } 1; Hope this gets you started, Issac
Re: templating system opinions
hi ( 03.07.21 17:04 -0500 ) Nigel Hamilton: At Turbo10 we went for a strict 'no functional elements' in the template approach. this seems like you're placing a technical limit on your solution. why wouldn't you use the technologies that will solve your problem the best instead of constraining the 'solution space' before considering the problem fully? But how do you do things like loops /loops for displaying rows in a report? exactly. the most intuitive way, to me, is to loop on the page. -- \js
mod_perl/freebsd
-BEGIN PGP SIGNED MESSAGE- I'd like to install mod_perl from ports on freebsd, but it complains: Error: you don't have the right version of perl in /usr/bin. This is correct, I want to install it against the version of perl in /usr/local/bin *not* against the version in /usr/bin. Anyone know what to do? ~~ Andy Harrison Great Works Internet System Operations (full headers for details) -BEGIN PGP SIGNATURE- Version: PGP 6.5.8 iQCUAwUBPx1FNFPEkLgodAWVAQFR7wP4u6m6l6qGwN8XK29riuyZiMCx72k88H/c pqvIZFHIhl8MMIlj1Rsh7bjfMitgSAQT6psFvWCnNjJJAkLL5P+p6GSxGhLsATJC 9BgTfdaPycpk/s2O/Lo00lCVVkv/YkmeGcJc/cebmTills93NRIs+k2C2x5orfk3 b9O7o4Ydvg== =SUXE -END PGP SIGNATURE-
Re: mod_perl/freebsd
At 10:09 AM 7/22/2003 -0400, Andy Harrison wrote: -BEGIN PGP SIGNED MESSAGE- I'd like to install mod_perl from ports on freebsd, but it complains: Error: you don't have the right version of perl in /usr/bin. This is correct, I want to install it against the version of perl in /usr/local/bin *not* against the version in /usr/bin. Anyone know what to do? Sounds like you didn't run 'use.perl ports' after installing the version from the ports. [EMAIL PROTECTED] hurstdog$ use.perl Usage: /usr/local/bin/use.perl port - /usr/bin/perl is the perl5 port /usr/local/bin/use.perl system - /usr/bin/perl is the system perl [EMAIL PROTECTED] hurstdog$ Thats on 4.7-RELEASE. It could have changed with the latest releases, I haven't checked. But I think that should solve your problem. -Andrew ~~ Andy Harrison Great Works Internet System Operations (full headers for details) -BEGIN PGP SIGNATURE- Version: PGP 6.5.8 iQCUAwUBPx1FNFPEkLgodAWVAQFR7wP4u6m6l6qGwN8XK29riuyZiMCx72k88H/c pqvIZFHIhl8MMIlj1Rsh7bjfMitgSAQT6psFvWCnNjJJAkLL5P+p6GSxGhLsATJC 9BgTfdaPycpk/s2O/Lo00lCVVkv/YkmeGcJc/cebmTills93NRIs+k2C2x5orfk3 b9O7o4Ydvg== =SUXE -END PGP SIGNATURE-
Re: Apache::UploadMeter
Thanks - I´ll try it and send response. I´ve read all readme-files and the build-in manual but I did´nt find something about that I have to use instance()... - Original Message - From: Issac Goldstand [EMAIL PROTECTED] To: Sven [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 3:21 PM Subject: Re: Apache::UploadMeter Sven wrote... [snip] - use Apache (); use Apache::Request (); $apr = Apache::Request-new($r); foreach $parm($apr-param){ print -.$parm. : .$apr-param($parm).\n; } print -\n; - First of all, use instance() instead of new(). I believe the documentation for Apache::UploadMeter mentions this. [snip] Can someone show me an example of a upload.pl where a file is stored on the server please? Sure. Here is the response handler for the testbed for Apache::UploadMeter at http://epoch.beamartyr.net/umtest/form.html package ApacheUploadMeterTest; use Apache::Request; use Apache::Constants qw(OK DECLINED); use CGI::Carp qw(fatalsToBrowser); use Data::Dumper; sub handler { my $r=shift; my $q=Apache::Request-instance($r, POST_MAX=2097152); # Actually, the above line doesn't work - POST_MAX will be a parameter to # Apache::UploadMeter in future releases local($|)=1; my $num=0; print PART1; Content-Type: text/html HTML HEAD TITLEApache::UploadMeter Test Module/TITLE /HEAD BODY H1Upload Complete/H1 PART1 foreach my $upload ($q-upload) { $num++; my $name=$upload-name; my $size=$upload-size; my $filename=$upload-filename; my $type=$upload-type; my $info=Dumper($upload-info); my $tempname=$upload-tempname; print EOP UL LIUpload field: $num/LI LIDetected upload field: $name/LI LIDetected filename: $filename ($size bytes)/LI LIReported MIME type: $type/LI LISpool file: $tempname/LI LIOther debug info: $info/LI /UL EOP } print /BODY/HTML\n; return OK; } 1; Hope this gets you started, Issac
mod_perl installation problem...
Hello, I've just come a cropper trying to reinstall mod_perl, and I'm a little desparate! Any help would be greatly appreciated. (I've 'a' mod_perl/apache running fine, but I can't get Apache::Cookie running along with) I'm trying to install: apache_1.3.28 + mod_perl-1.28 My config for mod_perl is : APACHE_SRC=../apache_1.3.28/src \ DO_HTTPD=1 EVERYTHING=1 \ DYNAMIC=1 USE_APACI=1 Though I've tried pretty much every variation on that with the same result.. During 'make test' I keep getting: modules/request...NOK 1Test header seen more than once! modules/request...NOK 2Test header seen more than once! modules/request...FAILED tests 1-10 Failed 10/10 tests, 0.00% okay snip Failed 1/34 test scripts, 97.06% okay. 10/318 subtests failed, 96.86% okay. make: *** [run_tests] Error 29 (also skips cookie, module and api) .. Thing is I've got a mod_perl running just fine - What I'm trying to do is install Apache::Cookie, but it won't because libapreq (1.2) is complaining... This is really driving me up the wall so any help would be fantastic. Thanks, Jimbo
Re: mod_perl installation problem...
On Tue, 22 Jul 2003, Jim Morrison [Mailing-Lists] wrote: Hello, I've just come a cropper trying to reinstall mod_perl, and I'm a little desparate! Any help would be greatly appreciated. (I've 'a' mod_perl/apache running fine, but I can't get Apache::Cookie running along with) I'm trying to install: apache_1.3.28 + mod_perl-1.28 My config for mod_perl is : APACHE_SRC=../apache_1.3.28/src \ DO_HTTPD=1 EVERYTHING=1 \ DYNAMIC=1 USE_APACI=1 Though I've tried pretty much every variation on that with the same result.. During 'make test' I keep getting: modules/request...NOK 1Test header seen more than once! modules/request...NOK 2Test header seen more than once! modules/request...FAILED tests 1-10 Failed 10/10 tests, 0.00% okay snip Failed 1/34 test scripts, 97.06% okay. 10/318 subtests failed, 96.86% okay. make: *** [run_tests] Error 29 (also skips cookie, module and api) .. Thing is I've got a mod_perl running just fine - What I'm trying to do is install Apache::Cookie, but it won't because libapreq (1.2) is complaining... It's strange that it runs modules/request but skips modules/cookie, as both should be run by a successful install of libapreq (which supplies Apache::Request and Apache::Cookie). Might a partial install of libapreq been made? It might be worth first tracking down the problems you had with libapreq, to see if resolving those would help with these mod_perl problems. -- best regards, randy kobes
RE: mod_perl installation problem... (A little more info)
Further to the below.. Just found my error_log which might be of some use.. The bit that glares at me is: [Tue Jul 22 16:38:47 2003] [error] Can't locate object method new via package Apache::Request at /usr/src/mod_perl-1.28/t/net/perl/api.pl line 11, fh1b line 1. Which is annoying because I can't install Apache::Request without it making similar complaints?! == Subroutine fileparse_set_fstype redefined at /usr/local/lib/perl5/5.8.0/File/Basename.pm line 154. Subroutine fileparse redefined at /usr/local/lib/perl5/5.8.0/File/Basename.pm line 168. Subroutine basename redefined at /usr/local/lib/perl5/5.8.0/File/Basename.pm line 235. Subroutine dirname redefined at /usr/local/lib/perl5/5.8.0/File/Basename.pm line 248. Constant subroutine CGI::XHTML_DTD redefined at /usr/local/lib/perl5/5.8.0/constant.pm line 108. [Tue Jul 22 16:38:42 2003] [warn] [notice] child_init for process 31133, report any problems to [no address given] [Tue Jul 22 16:38:45 2003] [warn] [client 127.0.0.1] log __ANON__ OK [Tue Jul 22 16:38:46 2003] [error] [client 127.0.0.1] File does not exist: /usr/src/mod_perl-1.28/t/docs/STAGE/u1/test.html [Tue Jul 22 16:38:46 2003] [error] [client 127.0.0.1] File does not exist: /usr/src/mod_perl-1.28/t/docs/STAGE/u1/nochance.html [Tue Jul 22 16:38:46 2003] [error] [client 127.0.0.1] File does not exist: /usr/src/mod_perl-1.28/t/docs/nochance.html [Tue Jul 22 16:38:47 2003] [error] Can't locate object method new via package Apache::Request at /usr/src/mod_perl-1.28/t/net/perl/api.pl line 11, fh1b line 1. *** The following [error] is expected, no cause for alarm *** [Tue Jul 22 16:38:48 2003] [error] Missing right curly or square bracket at /usr/src/mod_perl-1.28/t/docs/badsyntax.pl line 9, at end of line syntax error at /usr/src/mod_perl-1.28/t/docs/badsyntax.pl line 9, at EOF Compilation failed in require at /usr/src/mod_perl-1.28/t//docs/startup.pl line 249, fh1b line 1. *** The following [error] is expected, no cause for alarm *** [Tue Jul 22 16:38:48 2003] [error] Apache::Death at /dev/null line 0 *** The following [error] is expected, no cause for alarm *** [Tue Jul 22 16:38:48 2003] [error] Missing right curly or square bracket at /usr/src/mod_perl-1.28/t/docs/badsyntax.pl line 9, at end of line syntax error at /usr/src/mod_perl-1.28/t/docs/badsyntax.pl line 9, at EOF Compilation failed in require at /usr/src/mod_perl-1.28/t//docs/startup.pl line 249, fh1b line 1. *** The following [error] is expected, no cause for alarm *** [Tue Jul 22 16:38:48 2003] [error] Apache::Death at /dev/null line 0 [notice] child process 31133 terminating [notice] push'd PerlChildExitHandler called, pid=31133 [notice] push'd PerlChildExitHandler called, pid=31133 [notice] END block called for startup.pl [notice] Destruction-DESTROY called for $global_object == Hello, I've just come a cropper trying to reinstall mod_perl, and I'm a little desparate! Any help would be greatly appreciated. (I've 'a' mod_perl/apache running fine, but I can't get Apache::Cookie running along with) I'm trying to install: apache_1.3.28 + mod_perl-1.28 My config for mod_perl is : APACHE_SRC=../apache_1.3.28/src \ DO_HTTPD=1 EVERYTHING=1 \ DYNAMIC=1 USE_APACI=1 Though I've tried pretty much every variation on that with the same result.. During 'make test' I keep getting: modules/request...NOK 1Test header seen more than once! modules/request...NOK 2Test header seen more than once! modules/request...FAILED tests 1-10 Failed 10/10 tests, 0.00% okay snip Failed 1/34 test scripts, 97.06% okay. 10/318 subtests failed, 96.86% okay. make: *** [run_tests] Error 29 (also skips cookie, module and api) .. Thing is I've got a mod_perl running just fine - What I'm trying to do is install Apache::Cookie, but it won't because libapreq (1.2) is complaining... This is really driving me up the wall so any help would be fantastic. Thanks, Jimbo
Re: mod_perl/freebsd
-BEGIN PGP SIGNED MESSAGE- ~ On 22-Jul-2003, Andrew Hurst wrote message Re: mod_perl/freebsd ~ Usage: /usr/local/bin/use.perl port - /usr/bin/perl is the perl5 port /usr/local/bin/use.perl system - /usr/bin/perl is the system perl Could you tell me what this changes, exactly? I need to make certain that /usr/bin/perl stays at its current version (5.005_03). Does this simply update /etc/make.conf? I looked for a man page, but don't see it. ~~ Andy Harrison Great Works Internet System Operations (full headers for details) -BEGIN PGP SIGNATURE- Version: PGP 6.5.8 iQCVAwUBPx1jklPEkLgodAWVAQHu8wQAphPErffZC7yTpwGjYy48l1P6wPk+hzHe 6W9cPggLzNWY6tDPGf7kBXWSxeLAjG0YhrL03QmQXTJY805J/qTUwUdyUYCcXs4z S8sNajWWT79KIoPl3NvLvRoFHI/yZwyhGmlH57P4NznRheC0JjO+HKu9jWKV9iEI V1dW/Dls9ws= =LpYU -END PGP SIGNATURE-
Re: caching questions
On Tue, 2003-07-22 at 02:13, Tom Schindl wrote: Sorry to step in here, but could I use any of the caching modules you mentionned in mod_perl2? I can't vouch for the thread safety of these modules, but all of them should work in prefork mode. - Perrin
Re: mod_perl/freebsd
At 12:17 PM 7/22/2003 -0400, Andy Harrison wrote: -BEGIN PGP SIGNED MESSAGE- ~ On 22-Jul-2003, Andrew Hurst wrote message Re: mod_perl/freebsd ~ Usage: /usr/local/bin/use.perl port - /usr/bin/perl is the perl5 port /usr/local/bin/use.perl system - /usr/bin/perl is the system perl Could you tell me what this changes, exactly? I need to make certain that /usr/bin/perl stays at its current version (5.005_03). Does this simply update /etc/make.conf? I looked for a man page, but don't see it. Its a regular perl script, just open it up in your favorite text editor and read it. As far as I know (without reading over the source carefully) it just changes a few symlinks and changes a line in make.conf so that when you rebuild the world it will use the new perl. -Andrew ~~ Andy Harrison Great Works Internet System Operations (full headers for details) -BEGIN PGP SIGNATURE- Version: PGP 6.5.8 iQCVAwUBPx1jklPEkLgodAWVAQHu8wQAphPErffZC7yTpwGjYy48l1P6wPk+hzHe 6W9cPggLzNWY6tDPGf7kBXWSxeLAjG0YhrL03QmQXTJY805J/qTUwUdyUYCcXs4z S8sNajWWT79KIoPl3NvLvRoFHI/yZwyhGmlH57P4NznRheC0JjO+HKu9jWKV9iEI V1dW/Dls9ws= =LpYU -END PGP SIGNATURE-
what is $r-clear_rgy_endav?
Hi! What function $r-clear_rgy_endav($script_name) do in Apache::Registry before and $r-stash_rgy_endav($script_name) after eval-ing cgi script? -vlad
Re: [Fwd: Call for Participation for ApacheCon US 2003]
At 04:14 AM 7/22/2003, Stas Bekman wrote: If you would like to be a speaker at the ApacheCon US 2003 event, please go to the ApacheCon Web site, log in, and choose the 'Submit a CFP' option from the list there: I went through the process of creating an account only to find that the Submit a CFP option isn't there. Until they get that fixed, you can select Contact Us from the bottom menu, then under the cfp@ address there's a link to the online submission form. --Bill --- Bill Weinman http://bw.org/ Music http://music.bw.org/ Whois Client http://whois.bw.org/ Music Database http://www.webmusicdb.com/ --+
Re: modperl2 Apache::HTTP_FORBIDDEN and Apache::HTTP_INTERNAL_SERVER_ERRORimplemented?
Though I seem to be chasing it down to a possible problem with the method handler: sub handler ($$) But even with a change to: sub handler : method This is an interesting one. How to make the two coexist in the same code base. Ideally you want to do this: sub handler1 ($$) {} sub handler2 : method {} *handler = MP2 ? \handler2 : \handler1; But probably it'll complain about different prototypes. Or it might just work. Give it a try. Hi! Looks like your example will work, though, it is kind of messy, (probably because I don't completely follow the example). I basically added the handler code into the subroutines as defined: sub handler1 ($$) { my ($class, $r) = @_ ; my $type ; my $nonce = '' ; my $self ; ... } sub handler2 : method { my ($class, $r) = @_ ; my $type ; my $nonce = '' ; ... } *handler = MP2 ? \handler2 : \handler1; I am leaving the MP2 code in both of the subroutines, as I don't know if there is a prettier way to do this... (I will remove it, if there is not) Although this hasn't been tested extensively, it should be working fine now. thanks for the help! speeves cws PS It did complain about Prototype mismatch: sub Apache::AuthenNTLM::handler vs ($$) at /usr/local/lib/perl/5.6.1/Apache/AuthenNTLM.pm until I added the code into both subroutines.
Re: mod_perl/freebsd
-BEGIN PGP SIGNED MESSAGE- ~ On 22-Jul-2003, Andrew Hurst wrote message Re: mod_perl/freebsd ~ Its a regular perl script, just open it up in your favorite text editor and read it. As far as I know (without reading over the source carefully) it just changes a few symlinks and changes a line in make.conf so that when you rebuild the world it will use the new perl. Checked it out. It happily takes right over /usr/bin/perl. Can't have that... I've already put in place the make.conf updates that it suggests. ~~ Andy Harrison Great Works Internet System Operations (full headers for details) -BEGIN PGP SIGNATURE- Version: PGP 6.5.8 iQCVAwUBPx1qx1PEkLgodAWVAQGlqgQAuX/Bt5BH6j4lW7BA8TFJwkWvNJD5uOQt 9jZLEy+mLmBm+O3mN7UFpqW5ad0+y5ygsnYumHUBGTKbsdD6iuCxExhnzXzd8bCj XS/IvXAC9H5MIHmSNyx9X/9UOOZEOVmwsFxOtSlKgkn6DSPk7lUNVVBLZ5AYZEaJ EzAompt6K4M= =D4jQ -END PGP SIGNATURE-
Re: modperl2 Apache::HTTP_FORBIDDEN... [long post]
Stas Bekman wrote: Shannon Eric Peevey wrote: use constant MP2 = ($mod_perl::VERSION = 1.99); # test for the version of mod_perl, and use the appropriate libraries BEGIN { if (MP2) { require Apache::Const; require Apache::Access; require Apache::Connection; require Apache::Log; require Apache::RequestRec; require Apache::RequestUtil; apache::Const-import(-compile = ^ This might be a typo, but if you change that to Apache::Const (upper case 'A'), does that help? Fantastic!!! I have been staring at all of the wrong code for way too long... :P Thanks for taking the time to find my error :) I should have a working version by the beginning of next week. I think that this still won't work. The reason: Apache::Const-import(-compile = 'HTTP_UNAUTHORIZED','HTTP_INTERNAL_SERVER_ERROR','DECLINED','HTTP_FORBIDDEN','OK'); only compiles the constants, it doesn't import them. Drop the '-compile =' part, and then they will be imported. -compile tell Apache::Const to not import the constants but to compile them. It did work, in fact. (I was just snoozing on the job... :P ) Thanks, Randy! speeves cws
Which way is right for precompiling code in Apache perl handler:
1: doing like in Registry: my $eval = join( '', 'package ', $package, ';use Apache qw(exit);', 'sub handler {', $sub, \n}, # last line comment without newline? ); compile($eval); sub compile { my $eval = shift; Apache-untaint($eval); eval $eval; } == or 2: my $eval = join( '', 'package ', $package, ';use Apache qw(exit);', $sub ); precompile($eval); sub precompile { my $eval = shift; ... eval(\$func = sub { . $eval . };); return $func } === and calling it later 1: my $cv = \{$package\::handler}; eval { {$cv}($r, @_) } if $r-seqno; 2: $func = $SomePkgCache{.. {$func}; -vlad
Re: [Fwd: Call for Participation for ApacheCon US 2003]
Actually, it is. I found it by going to the ApacheCon 2003 page, click the CFP link and then logging in. The page Stas sent doens't appear to work directly... Issac - Original Message - From: Bill Weinman [EMAIL PROTECTED] To: mod_perl Mailing List [EMAIL PROTECTED] Sent: Tuesday, July 22, 2003 7:36 PM Subject: Re: [Fwd: Call for Participation for ApacheCon US 2003] At 04:14 AM 7/22/2003, Stas Bekman wrote: If you would like to be a speaker at the ApacheCon US 2003 event, please go to the ApacheCon Web site, log in, and choose the 'Submit a CFP' option from the list there: I went through the process of creating an account only to find that the Submit a CFP option isn't there. Until they get that fixed, you can select Contact Us from the bottom menu, then under the cfp@ address there's a link to the online submission form. --Bill --- Bill Weinman http://bw.org/ Music http://music.bw.org/ Whois Client http://whois.bw.org/ Music Database http://www.webmusicdb.com/ --+
Re: Which way is right for precompiling code in Apache perlhandler:
They are equivalent. You can use either one. - Perrin
[mp2] beta of Apache-AuthenNTLM uploaded
The uploaded file Apache-AuthenNTLM-2.01.tar.gz has entered CPAN as file: $CPAN/authors/id/S/SP/SPEEVES/Apache-AuthenNTLM-2.01.tar.gz size: 50644 bytes md5: f175a98ea668e81df9cc8d6db629facf The purpose of this module is to perform a user authentication via Mircosoft's NTLM protocol. (This module also implements Basic Authentication for all other browsers ). You may download this beta version of Apache-AuthenNTLM from CPAN. It is not a replacement for the existing version on CPAN, but instead will work with either version of modperl. Please, feel free to download it and send me any bug reports... :) thanks, speeves cws
Re: AuthenNTLM - Help
Francisco de Assis Tristão wrote: Shannon, i got it configured with apache-1.3.27/mod_ssl/2.8.12 OpenSSL/0.9.6g mod_perl/1.25, all by hand, but it only works fine when i use just http - when i access the pages with https, apache doesn't ask for the user... Have you any idea about what is wrong? The version of apache with mod_ssl i took from sunfreeware, mod_perl and ApacheAuthenNTLM i compiled by myself. Sorry, I don't know why this might be happening... Are you running through a proxy server? I have seen a lot of problems when ntlm authentication through a proxy server... speeves cws
Apache 1.3.27 configure error with mod_perl 1.28, perl 5.8.0, gcc 3.3 on Solaris 2.8
I'm unable to get Apache sucessfully configured with these releases.I get the following error: Error Output for sanity check cd ..; gcc -DSOLARIS2=280 -DMOD_PERL -DUSE_PERL_SSI -B/usr/ccs/bin -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DNO_DL_NEEDED -B/usr/ccs/bin -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 `./apaci` -I. -I/utilnsg_solaris/perl5.8.0/lib/5.8.0/sun4-solaris/CORE-o helpers/dummy helpers/dummy.c -lsocket -lnsl -lpthread -W1,-E -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3 /utilnsg_solaris/perl5.8.0/lib/5.8.0/sun4-solaris/auto/DynaLoader/DynaLoader.a -L/utilnsg_solaris/perl5.8.0/lib/5.8.0/sun4-solaris/CORE -lperl -lsocket -lnsl -ldl -lm -lc cc1: error: unrecognized option `-W1,-E' make: *** [dummy] Error 1 = End of Error Report = I have my path set to look at gcc and binutils 2.14.But it's still trying to use /usr/ccs/bin for ar and ld. I do not have the Sun ANSI compiler. I've looked high and low and read about various issues with the GNU stuff, but haven't seen this particular error recounted. Any help is greatly appreciated. chris
Re: Apache 1.3.27 configure error with mod_perl 1.28, perl 5.8.0, gcc 3.3 on Solaris 2.8
At 03:50 PM 7/22/2003 -0500, Chris Fabri wrote: I'm unable to get Apache sucessfully configured with these releases.I get the following error: Error Output for sanity check cd ..; gcc -DSOLARIS2=280 -DMOD_PERL -DUSE_PERL_SSI -B/usr/ccs/bin -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DNO_DL_NEEDED -B/usr/ccs/bin -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 `./apaci` -I. -I/utilnsg_solaris/perl5.8.0/lib/5.8.0/sun4-solaris/CORE-o helpers/dummy helpers/dummy.c -lsocket -lnsl -lpthread -W1,-E -L/usr/local/lib/gcc-lib/sparc-sun-solaris2.8/2.95.3 /utilnsg_solaris/perl5.8.0/lib/5.8.0/sun4-solaris/auto/DynaLoader/DynaLoader.a -L/utilnsg_solaris/perl5.8.0/lib/5.8.0/sun4-solaris/CORE -lperl -lsocket -lnsl -ldl -lm -lc cc1: error: unrecognized option `-W1,-E' make: *** [dummy] Error 1 = End of Error Report = I forgot to say how exactly I arrived at this error. Here's my most recent foray after extracting mod_perl-1.28 and apache_1.3.27: perl Makefile.PL APACHE_SRC=../apache_1.3.27/src DO_HTTPD=1 USE_APACI=1 EVERYTHING=1 APACHE_PREFIX=/usr/local/apache_1.3.27 I get the same error of I go the flexible way. chris
Apache::DBI and temporary tables
Hello all, I know from a DBI perspective, when using PostgreSQL, if I create a temporary database table it will automatically go *poof* and be deleted when the database connection is closed (or when the transaction is finished...I can't remember which). Anyway, what will happen if code that takes advantage of this is used in an Apache Registry script? If I do a $dbh-disconnect, I know it will be ignored by Apache::DBI, but is it smart enough to pass something back to the database server telling it that it can purge temporary data? Thanks. -- /* Michael A. Nachbaur [EMAIL PROTECTED] * http://nachbaur.com/pgpkey.asc */ `This must be Thursday,' said Arthur to himself, sinking low over his beer, `I never could get the hang of Thursdays.'
Re: Apache::DBI and temporary tables
On Tue, 2003-07-22 at 17:15, Michael A Nachbaur wrote: If I do a $dbh-disconnect, I know it will be ignored by Apache::DBI, but is it smart enough to pass something back to the database server telling it that it can purge temporary data? No. If you come up with a way to do that, you can add it as a cleanup handler. - Perrin
Re: Apache::DBI and temporary tables
On Tue, 22 Jul 2003 14:15:41 -0700 Michael A Nachbaur [EMAIL PROTECTED] wrote: Hello all, I know from a DBI perspective, when using PostgreSQL, if I create a temporary database table it will automatically go *poof* and be deleted when the database connection is closed (or when the transaction is finished...I can't remember which). Anyway, what will happen if code that takes advantage of this is used in an Apache Registry script? If I do a $dbh-disconnect, I know it will be ignored by Apache::DBI, but is it smart enough to pass something back to the database server telling it that it can purge temporary data? While I'm not 100% sure, I would seriously doubt it since Apache::DBI doesn't call the corresponding DBD's disconnect method. I would do one of the following: 1) Explicitly clean up your temp table. 2) See if you can stop using Apache::DBI. I found on several sites that Apache::DBI didn't effect performance as much as I would have imagined with PostgreSQL and was fine to run without it. - Frank Wiles [EMAIL PROTECTED] http://frank.wiles.org -
Re: Apache 1.3.27 configure error with mod_perl 1.28, perl 5.8.0, gcc 3.3 on Solaris 2.8
At 03:50 PM 7/22/2003, Chris Fabri wrote: helpers/dummy.c -lsocket -lnsl -lpthread -W1,-E -L/usr/local/lib/gcc-lib/sparc- ..^^^ I think your problem is with the stray comma in the command line there ... I think if you check all your configurations and make files and get that fixed, it will work (at least get beyond that error). --Bill --- Bill Weinman http://bw.org/ Music http://music.bw.org/ Whois Client http://whois.bw.org/ Music Database http://www.webmusicdb.com/ --+
Re: Apache 1.3.27 configure error with mod_perl 1.28, perl 5.8.0, gcc 3.3 on Solaris 2.8
At 04:35 PM 7/22/2003 -0500, Bill Weinman wrote: At 03:50 PM 7/22/2003, Chris Fabri wrote: helpers/dummy.c -lsocket -lnsl -lpthread -W1,-E -L/usr/local/lib/gcc-lib/sparc- ..^^^ I think your problem is with the stray comma in the command line there ... I think if you check all your configurations and make files and get that fixed, it will work (at least get beyond that error). I'm not even getting as far as the make when I get the error.If I build mod_perl separately, and remove all references to these flags from the makefiles, and the run apache's config, I still get this error during configuration. Apache builds fine when I don't include mod_perl in the build, so it's definitely related to mod_perl. chris
Re: Apache 1.3.27 configure error with mod_perl 1.28, perl 5.8.0, gcc 3.3 on Solaris 2.8
At 04:45 PM 7/22/2003, Chris Fabri wrote: I'm not even getting as far as the make when I get the error.If I build mod_perl separately, and remove all references to these flags from the makefiles, and the run apache's config, I still get this error during configuration. Where do you find those flags in the makefiles? I don't see them anywhere in my copy. --Bill --- Bill Weinman http://bw.org/ Music http://music.bw.org/ Whois Client http://whois.bw.org/ Music Database http://www.webmusicdb.com/ --+
Re: what is $r-clear_rgy_endav?
wrote: Hi! What function $r-clear_rgy_endav($script_name) do in Apache::Registry before and $r-stash_rgy_endav($script_name) after eval-ing cgi script? resets the list of END blocks that possible have been inserted from the registry script. __ 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
[Patch] Apache::DBI - correctly clean up handles and reset attributes
Hi, Over the past few months I have posted a couple of fixes in relation to how Apache::DBI handles are cleaned up. This however is the most complete fix in that it covers the following issues :- TimeOut = 0 : Should always ping even when multiple requests are made in the same secondi Setting Attributes post connection : $dbh-{AutoCommit}=0 will convert an AutoCommit handle to non AutoCommit so when it is next retunred it behaves incorrectly. Other settings can be effected in the same way. Using begin_work : This is a tempory version of the above. The next commit resets the handle to the default value. I have tested this under mp1 but do not have any active setups for testing under mp2. I have not found that this fix degrades performance but I have not done exhautive benchmarking on multiple platforms. I would be grateful for all feedback in relation to this patch both good and bad.. The patch is against the current CVS version. Thank you all Paddy --- Changes 2003-07-20 09:03:15.0 + +++ Changes 2003-07-21 09:02:11.0 + @@ -1,5 +1,11 @@ Revision history for ApacheDBI. +patch July 21, 2003 +- Fixed issues relating to chanding handle state post connection. + Handles now returned in same state as original and incomplete + transactions rolled back before re-issuing handle so begin_work + should now be safe. Patrick Mulvany [EMAIL PROTECTED] + 0.92-dev - Avoid use of uninitialized value warning under mod_perl 2. --- DBI.pm 2003-06-10 12:20:06.0 + +++ DBI.cleanup.pm 2003-07-21 09:22:34.0 + @@ -23,6 +23,8 @@ my %LastPingTime; # keeps track of last ping per data_source my $Idx; # key of %Connected and %Rollback. +# Check to see if we need to reset TaintIn and TaintOut +my $TaintInOut = ($DBI::VERSION=1.31)?1:0; # supposed to be called in a startup script. # stores the data_source of all connections, which are supposed to be created upon @@ -87,11 +89,13 @@ } # this PerlCleanupHandler is supposed to initiate a rollback after the script has finished if AutoCommit is off. -my $needCleanup = ($Idx =~ /AutoCommit[^\d]+0/) ? 1 : 0; +# however cleanup can only be determined at end of handle life as begin_work may have been called to temporarily turn off AutoCommit. +# # TODO - Fix mod_perl 2.0 here -if(!$Rollback{$Idx} and $needCleanup and Apache-can('push_handlers')) { +if(!$Rollback{$Idx} and Apache-can('push_handlers')) { print STDERR $prefix push PerlCleanupHandler \n if $Apache::DBI::DEBUG 1; Apache-push_handlers(PerlCleanupHandler, \cleanup); + # make sure, that the rollback is called only once for every # request, even if the script calls connect more than once $Rollback{$Idx} = 1; @@ -101,7 +105,8 @@ $PingTimeOut{$dsn} = 0 unless $PingTimeOut{$dsn}; $LastPingTime{$dsn} = 0 unless $LastPingTime{$dsn}; my $now = time; -my $needping = (($PingTimeOut{$dsn} == 0 or $PingTimeOut{$dsn} 0) and $now - $LastPingTime{$dsn} $PingTimeOut{$dsn}) ? 1 : 0; +# Must ping if TimeOut = 0 else base on time +my $needping = ($PingTimeOut{$dsn} == 0 or ($PingTimeOut{$dsn} 0 and $now - $LastPingTime{$dsn} $PingTimeOut{$dsn})) ? 1 : 0; print STDERR $prefix need ping: , $needping == 1 ? yes : no, \n if $Apache::DBI::DEBUG 1; $LastPingTime{$dsn} = $now; @@ -112,6 +117,10 @@ # RaiseError being on and the handle is invalid. if ($Connected{$Idx} and (!$needping or eval{$Connected{$Idx}-ping})) { print STDERR $prefix already connected to '$Idx'\n if $Apache::DBI::DEBUG 1; + +# Force clean up of handle in case previous transaction failed to clean up the handle +reset_startup_state(); + return (bless $Connected{$Idx}, 'Apache::DBI::db'); } @@ -121,6 +130,9 @@ $Connected{$Idx} = $drh-connect(@args); return undef if !$Connected{$Idx}; +# store the parameters of the initial connection in the handle +set_startup_state($Connected{$Idx}); + # return the new database handle print STDERR $prefix new connect to '$Idx'\n if $Apache::DBI::DEBUG; return (bless $Connected{$Idx}, 'Apache::DBI::db'); @@ -158,6 +170,47 @@ 1; } +# Store the default start state of each dbh in the handle +# Note: This uses private_Apache_DBI hash ref to store it in the handle itself + +sub set_startup_state { +foreach my $key qw{ AutoCommit Warn CompatMode InactiveDestroy +PrintError RaiseError HandleError +ShowErrorStatement TraceLevel FetchHashKeyName +ChopBlanks LongReadLen LongTruncOk +Taint Profile} { +$Connected{$Idx}-{private_Apache_DBI}{$key} =