cvs commit: modperl-2.0/t/preconnection/TestPreConnection - New directory

2003-01-19 Thread stas
stas2003/01/19 23:55:35

  modperl-2.0/t/preconnection/TestPreConnection - New directory



cvs commit: modperl-2.0/t/preconnection/TestPreConnection note.pm

2003-01-19 Thread stas
stas2003/01/19 23:56:17

  Added:   t/preconnection note.t
   t/preconnection/TestPreConnection note.pm
  Log:
  add a simple test to verify that PreConnection handlers are working
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/preconnection/note.t
  
  Index: note.t
  ===
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  use Apache::TestRequest;
  
  my $module = TestPreConnection::note;
  Apache::TestRequest::module($module);
  my $hostport = Apache::TestRequest::hostport(Apache::Test::config());
  my $location = http://$hostport/$module;;
  t_debug(connecting to $location);
  plan tests = 1;
  
  ok t_cmp(
  'ok', 
  GET_BODY($location),
  connection notes);
  
  
  
  1.1  modperl-2.0/t/preconnection/TestPreConnection/note.pm
  
  Index: note.pm
  ===
  package TestPreConnection::note;
  
  use strict;
  use warnings;# FATAL = 'all';
  
  use Apache::Connection ();
  
  use Apache::Const -compile = qw(OK);
  
  sub handler {
  my Apache::Connection $c = shift;
  
  $c-notes-set(preconnection = 'ok');
  
  return Apache::OK;
  }
  
  use constant BUFF_LEN = 1024;
  
  sub response {
  my $r = shift;
  
  $r-content_type('text/plain');
  $r-print($r-connection-notes-get('preconnection') || '');
  
  return Apache::OK
  }
  
  1;
  __END__
  NoAutoConfig
VirtualHost TestPreConnection::note
  PerlPreConnectionHandler TestPreConnection::note

  Location /TestPreConnection::note
SetHandler modperl
PerlResponseHandler TestPreConnection::note::response
  /Location
/VirtualHost
  /NoAutoConfig
  
  
  
  
  



cvs commit: modperl-2.0/t/preconnection/TestPreConnection note.pm

2003-01-19 Thread stas
stas2003/01/19 23:59:44

  Modified:t/preconnection/TestPreConnection note.pm
  Log:
  cleanup
  
  Revision  ChangesPath
  1.2   +1 -3  modperl-2.0/t/preconnection/TestPreConnection/note.pm
  
  Index: note.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/preconnection/TestPreConnection/note.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- note.pm   20 Jan 2003 07:56:17 -  1.1
  +++ note.pm   20 Jan 2003 07:59:44 -  1.2
  @@ -1,7 +1,7 @@
   package TestPreConnection::note;
   
   use strict;
  -use warnings;# FATAL = 'all';
  +use warnings FATAL = 'all';
   
   use Apache::Connection ();
   
  @@ -14,8 +14,6 @@
   
   return Apache::OK;
   }
  -
  -use constant BUFF_LEN = 1024;
   
   sub response {
   my $r = shift;
  
  
  



DBI Mod_perl2

2003-01-19 Thread Daryl Lee
Should I expect DBI to work with mod_perl2?  I have a simple script that
just connects to a MySQL database and reports success or faiure.  When I
run it from cgi-bin as a regular CGI script, it succeeds.  When I put it in
my mod_perl script directory, it runs, but fails to connect.  My mod_perl
directory is configured as:

Alias /cgi /usr/local/apache2/perl
Location /cgi
  SetHandlerperl-script
  PerlResponseHandler   ModPerl::Registry
  PerlOptions   +ParseHeaders
/Location

The script is named dbi.pl.  Thus, http://localhost/cgi-bin/dbi.pl connects
okay, but http://localhost/cgi/dbi.pl fails to connect

-- 
Daryl Lee
Open the present--it's a gift.



RE: a javscript in perl

2003-01-19 Thread Joe Palladino
Have you tried build the JavaScript dynamically in the perl code?

-- Joe

-Original Message-
From: koudjo ametepe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 5:08 AM
To: [EMAIL PROTECTED]
Subject: a javscript in perl 


hello everybody ,
Thank you for yours answers that help me in my project .
I have a little problem .
For passing through pages of my intranet i made a javascript menu .But i
c'ant use perl variables in it .
Example : use the variable $this_script for the link page but not link.html

Thank you for your ideas
koudjo



_
MSN Search, le moteur de recherche qui pense comme vous !
http://search.msn.fr/worldwide.asp
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.441 / Virus Database: 247 - Release Date: 1/9/2003




mod_rewrite + PerlTransHandler

2003-01-19 Thread Torsten Foertsch
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I am trying to get a PerlTransHandler called *after* some mod_rewrite 
processing.

I thought if I configure the rewrite rules *before* the PerlTransHandler:

RewriteEngine   On
RewriteRule ... [PT]
PerlTransHandler Apache::TestTrans::transhandler

it would work that way. But it does not.

Apache::TestTrans::transhandler is always called *before* mod_rewrite 
processing.

Is there a way to determine the handler order?

Thanks
Torsten
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+Kt+/wicyCTir8T4RAqmNAJsGfm6CaPueSjCRAIA/BZ1BgWtxxACfWCLY
GAo8nB1xxL1r+7blx7+qbi8=
=473P
-END PGP SIGNATURE-



Apache::Session::File hangs

2003-01-19 Thread Axel Huizinga
Hi!

The following code hangs after reloading and the try to tie again the 
previously created session! WHY?

package Loop;

use strict;

use Apache;
use Apache::Session::File;
use CGI qw(:cgi);

use Devel::Symdump;
use Data::Dumper;

use vars qw(
   $id $sID
   $lockDir
   %session $sessionDir
   );
sub handler{
   if(defined ($id = param(sID))  -f 
/usr/local/httpd/htdocs/action/sessions/$id){
   print STDERR found $id :-}\n;
   $sID =1;
   eval{   
   tie %session, 'Apache::Session::File', $id,{
   Directory = '/usr/local/httpd/htdocs/action/sessions',
   LockDirectory = '/usr/local/httpd/htdocs/action/lock'
   };
   };
   }
   else{
   eval{   
   tie %session, 'Apache::Session::File', undef,{
   Directory = '/usr/local/httpd/htdocs/action/sessions',
   LockDirectory = '/usr/local/httpd/htdocs/action/lock'
   };
   };
   $id = $session{_session_id};
   }

   if($@){print STDERR oops $@\n;}
   untie %session;
   print STDERR $id redirecting2: 
http://$ENV{'HTTP_HOST'}$ENV{'SCRIPT_NAME'}?sID=$id\n;
   print redirect http://$ENV{'HTTP_HOST'}$ENV{'SCRIPT_NAME'}?sID=$id;

}
1;
on STDERR I get:

c838622a5e5ec2b39a26c67b6731188f redirecting2: 
http://localhost/action/leer.html?sID=c838622a5e5ec2b39a26c67b6731188f
found c838622a5e5ec2b39a26c67b6731188f :-}

my .htaccess :

FilesMatch .*\.html$
   SetHandler perl-script
   PerlHandler Loop
/FilesMatch

Thanks,
Axel





RE: a javscript in perl

2003-01-19 Thread Wilson, Allen
I agree...with building it dynamically

I've done that myself...you build the javascript based
on a parameter that is passed to the script.



Allen


-Original Message-
From:   Joe Palladino [mailto:[EMAIL PROTECTED]]
Sent:   Sun 1/19/2003 10:38 AM
To: [EMAIL PROTECTED]
Cc: 
Subject:RE: a javscript in perl 
Have you tried build the JavaScript dynamically in the perl code?

-- Joe

-Original Message-
From: koudjo ametepe [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 15, 2003 5:08 AM
To: [EMAIL PROTECTED]
Subject: a javscript in perl 


hello everybody ,
Thank you for yours answers that help me in my project .
I have a little problem .
For passing through pages of my intranet i made a javascript menu .But i
c'ant use perl variables in it .
Example : use the variable $this_script for the link page but not link.html

Thank you for your ideas
koudjo



_
MSN Search, le moteur de recherche qui pense comme vous !
http://search.msn.fr/worldwide.asp
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.441 / Virus Database: 247 - Release Date: 1/9/2003





This message may contain proprietary or confidential company information.
Any unauthorized use or disclosure is prohibited.




Re: Apache::Session::File hangs

2003-01-19 Thread Perrin Harkins
Axel Huizinga wrote:

The following code hangs after reloading and the try to tie again the 
previously created session! WHY?
...

use vars qw(
   $id $sID
   $lockDir
   %session $sessionDir
   );


The session variable has to go out of scope for the lock to be released. 
 I know it seems like the untie should do it, but try making %session a 
lexical instead of a global.

- Perrin



mod_perl 2 APache 2.0 MPM

2003-01-19 Thread Sinclair, Alan (CORP, GEAccess)
All,
Starting to strike the first blows with Apache 2.0. I am now wondering about
thread safety with mod_perl 2. Will mod_perl support a threaded MPM Apache
config ?

Thanks,




Re: DBI Mod_perl2

2003-01-19 Thread Stas Bekman
Daryl Lee wrote:

Should I expect DBI to work with mod_perl2?  I have a simple script that
just connects to a MySQL database and reports success or faiure.  When I
run it from cgi-bin as a regular CGI script, it succeeds.  When I put it in
my mod_perl script directory, it runs, but fails to connect.  My mod_perl
directory is configured as:

Alias /cgi /usr/local/apache2/perl
Location /cgi
  SetHandlerperl-script
  PerlResponseHandler   ModPerl::Registry
  PerlOptions   +ParseHeaders
/Location

The script is named dbi.pl.  Thus, http://localhost/cgi-bin/dbi.pl connects
okay, but http://localhost/cgi/dbi.pl fails to connect


Should work just fine, but you need the latest DBI version. I believe 1.31 
(but 1.32 is out). Does anybody remember the exact version required, I 
don't see anything relevant in the Changes file. I've added this item to 
the troubleshooting version.

If the problem persists please send a complete report as explained here:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems
and attach the the shortest possible version of the script that still 
reproduces the problem.


__
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: mod_rewrite + PerlTransHandler

2003-01-19 Thread Stas Bekman
Torsten Foertsch wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi,

I am trying to get a PerlTransHandler called *after* some mod_rewrite 
processing.

I thought if I configure the rewrite rules *before* the PerlTransHandler:

RewriteEngine   On
RewriteRule	...	[PT]
PerlTransHandler Apache::TestTrans::transhandler

it would work that way. But it does not.

Apache::TestTrans::transhandler is always called *before* mod_rewrite 
processing.

Is there a way to determine the handler order?

Not in mod_perl 1.0. Your best bet is probably to move the mod_rewrite's 
rules into your perl transhandler.

It should be possible in 2.0, though the API is not there yet. Apache 2.0 
allows to insert handlers before/after a specified handler + other options.

__
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: mod_perl 2 APache 2.0 MPM

2003-01-19 Thread Stas Bekman
Sinclair, Alan (CORP, GEAccess) wrote:

All,
Starting to strike the first blows with Apache 2.0. I am now wondering about
thread safety with mod_perl 2. Will mod_perl support a threaded MPM Apache
config ?


Why using the future tense, it does support the threaded mpm pretty much 
from the very beginning.

re: thread-safety see:
http://perl.apache.org/search/swish.cgi?query=thread-safesbm=SecIsubmit=search

__
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] failed test building mp2

2003-01-19 Thread Stas Bekman
Nick Tonkin wrote:

On Sun, 19 Jan 2003, Stas Bekman wrote:



Nick Tonkin wrote:


On Fri, 17 Jan 2003, Nick Tonkin wrote:




Hey all,

Building the latest mp2 I get:
protocol/echo_filter.ok  
Failed Test   Stat Wstat Total Fail  Failed  List of Failed
---
apr/threadmutex.t33 100.00%  1-3
*** server localhost.rlnt.net:8529 shutdown
!!! error running tests (please examine t/logs/error_log)
*** Error code 1


Nick et al, please submit a complete bug report as explained here:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems
(linked from the shortcuts menu!).



grumble
Hrmph. There should be a lynx-friendly version of these sites. All that
cool template-driven menu stuff just turns into a long long list of links!
/grumble


Eh? What user-unfriendly do you find about perl.apache.org when using 
lynx? It looks very good in it. In any case let's not mix too many things 
in one thread and if you think you can offer to make it better docs-dev / 
perl.apache.org is the list to discuss this kind of issues.

OK. Bug report sent under different mail, using latest cvs
sources. There's two errors now, used to be one!


That's OK. See the followup in reply to your report.

[...]

Patch made no difference to the error.


Can you try to step through with gdb and see what the problem is?
This should help:
http://perl.apache.org/docs/2.0/devel/debug/c.html#Precooked_gdb_Startup_Scripts
You should break at modperl_mgv_resolve, which is probably called from 
modperl_handler_resolve and step through to see where it fails.

__
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