RE: MP2 - Make test Error - t/api/request_rec.t
[prev]
[thread]
[next]
[Date index for 2005/01/10]
This is a multi-part message in MIME format.
------_=_NextPart_001_01C4F767.D6A6198D
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
>> sorry, I have no idea. If you reduce your code to a simple few-lines
>> script/handler and post it here, I'm sure someone will figure out =
what the
>> problem is, and whether it's an issue with your code or a bug in mp2.
Thanks Stas, I'll take all the help I can get... I've been trying to =
figure this out all day without any luck, I thought I could put to rest =
any problems with code once I went with a content handler and put =
everything in a subdirectory so I could be sure I don't have any messy =
global values.
=20
This code has been working on a previous server with no problems, we are =
moving to a new server and this is the result of the same code but after =
a new apache and mod_perl install.
In short I can sit there and refresh the same page and over and over, =
sometimes I get the right page, other times I get other pages
=20
Thanks in Advance!
-Chris
=20
Below are the basics:
=20
Index.pm:
=20
package MALDEN::scripts::Index;
use Apache::Const -compile =3D> qw(:common REDIRECT OK);
use strict;
use Mail::Sendmail;
use XML::RSS;
use POSIX qw(strftime);
use vars qw($db $r $CGI $user_name $user_role);
#########################################################################=
#################
# Main
# Our Mod_Perl Content Handler
sub handler {
$r =3D shift;
# Define our root HTML template path
$ENV{'HTML_TEMPLATE_ROOT'} =3D "/websites/MALDEN/templates";
# Create a new global CGI object
$CGI =3D new CGI();
# Create a global DB connection
$db =3D TOOLS::PublicConnectDB->connect_to_db();
# Authenticate
auth_incoming_user();
# Determine what we want to do based on the request
# Most functions will return "OK" after the "display page" subroutine
# but for those that we have to redirect, the redirect directive and =
the URL will be returned
my $back_url =3D "";
my $request_type =3D "";
($request_type,$back_url) =3D determine_proper_action();
=20
# Properly Exit the Handler from all subs within Determine Proper =
Action
if ($request_type eq 'Apache::REDIRECT') {
$r->headers_out->set(Location =3D> $back_url);
return Apache::REDIRECT;
} else {
return Apache::OK;
}
=20
} # End of Sub
#########################################################################=
#################
And its defined in apache as
=20
<VirtualHost xxxx:80>
.....
PerlModule MALDEN::scripts::Index
<Location "/index">
SetHandler perl-script
PerlHandler MALDEN::scripts::Index
</Location>
.....
</VirtualHost>
------_=_NextPart_001_01C4F767.D6A6198D
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">=0A=
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">=0A=
<HTML>=0A=
<HEAD>=0A=
=0A=
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.5.7226.0">=0A=
<TITLE>Re: MP2 - Make test Error - t/api/request_rec.t</TITLE>=0A=
</HEAD>=0A=
<BODY>=0A=
<DIV id=3DidOWAReplyText6680 dir=3Dltr>=0A=
<DIV dir=3Dltr><FONT size=3D2>>> sorry, I have no idea. If you =
reduce your =0A=
code to a simple few-lines<BR>>> script/handler and post it here, =
I'm sure =0A=
someone will figure out what the<BR>>> problem is, and whether =
it's an =0A=
issue with your code or a bug in mp2.<BR></FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>Thanks Stas, I'll take all the help I can =
get... I've =0A=
been trying to figure this out all day without any luck, I thought I =
could put =0A=
to rest any problems with code once I went with a content handler and =
put =0A=
everything in a subdirectory so I could be sure I don't have any messy =
global =0A=
values.</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2></FONT> </DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>This code has been working on a previous =
server with =0A=
no problems, we are moving to a new server and this is the result of the =
same =0A=
code but after a new apache and mod_perl install.</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>In short I can sit there and refresh the =
same page and =0A=
over and over, sometimes I get the right page, other times I get other =0A=
pages</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2></FONT> </DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>Thanks in Advance!</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>-Chris</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2></FONT> </DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>Below are the basics:</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2></FONT> </DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>Index.pm:</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2></FONT> </DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>package MALDEN::scripts::Index;<BR>use =
Apache::Const =0A=
-compile =3D> qw(:common REDIRECT OK);</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>use strict;<BR>use Mail::Sendmail;<BR>use =0A=
XML::RSS;<BR>use POSIX qw(strftime);<BR>use vars qw($db $r $CGI =
$user_name =0A=
$user_role);</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT =0A=
size=3D2>################################################################=
##########################<BR># =0A=
Main<BR># Our Mod_Perl Content Handler<BR>sub handler {<BR> $r =3D =0A=
shift;</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2> # Define our root HTML template =0A=
path<BR> $ENV{'HTML_TEMPLATE_ROOT'} =3D =0A=
"/websites/MALDEN/templates";</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2> # Create a new global CGI =
object<BR> $CGI =3D =0A=
new CGI();</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2> # Create a global DB =
connection<BR> $db =3D =0A=
TOOLS::PublicConnectDB->connect_to_db();<BR></FONT><FONT =
size=3D2> # =0A=
Authenticate<BR> auth_incoming_user();</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2> # Determine what we want to do based =
on the =0A=
request<BR> # Most functions will return "OK" after the "display =
page" =0A=
subroutine<BR> # but for those that we have to redirect, the =
redirect =0A=
directive and the URL will be returned<BR> my =
$back_url =3D =0A=
"";<BR> my $request_type =3D "";<BR> ($request_type,$back_url) =
=3D =0A=
determine_proper_action();<BR> <BR> # Properly Exit the =
Handler from =0A=
all subs within Determine Proper Action<BR> if ($request_type eq =0A=
'Apache::REDIRECT') {<BR> $r->headers_out->set(Location =
=3D> =0A=
$back_url);<BR> return =0A=
Apache::REDIRECT;<BR> } else {<BR> return =0A=
Apache::OK;<BR> }<BR> <BR>} # End of =0A=
Sub<BR>##################################################################=
########################<BR></FONT><FONT =0A=
size=3D2></FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>And its defined in apache as</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2></FONT> </DIV>=0A=
<DIV dir=3Dltr><VirtualHost xxxx:80></DIV>=0A=
<DIV dir=3Dltr>.....</DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>PerlModule =
MALDEN::scripts::Index<BR><Location =0A=
"/index"><BR> SetHandler =0A=
perl-script<BR> PerlHandler =0A=
MALDEN::scripts::Index<BR></Location></FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>.....</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2></VirtualHost></DIV></FONT></DIV>=0A=
=0A=
</BODY>=0A=
</HTML>
------_=_NextPart_001_01C4F767.D6A6198D--
 |
 |
RE: MP2 - Make test Error - t/api/request_rec.t
cfaust-dougot 22:58 on 10 Jan 2005
|