RE: MP2 - Make test Error - t/api/request_rec.t

[prev] [thread] [next] [Date index for 2005/01/10]

From: cfaust-dougot
Subject: RE: MP2 - Make test Error - t/api/request_rec.t
Date: 22:58 on 10 Jan 2005
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>&gt;&gt; sorry, I have no idea. If you =
reduce your =0A=
code to a simple few-lines<BR>&gt;&gt; script/handler and post it here, =
I'm sure =0A=
someone will figure out what the<BR>&gt;&gt; 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>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>Below are the basics:</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2></FONT>&nbsp;</DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>Index.pm:</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2></FONT>&nbsp;</DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>package MALDEN::scripts::Index;<BR>use =
Apache::Const =0A=
-compile =3D&gt; 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>&nbsp;$r =3D =0A=
shift;</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>&nbsp;# Define our root HTML template =0A=
path<BR>&nbsp;$ENV{'HTML_TEMPLATE_ROOT'} =3D =0A=
"/websites/MALDEN/templates";</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>&nbsp;# Create a new global CGI =
object<BR>&nbsp;$CGI =3D =0A=
new CGI();</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>&nbsp;# Create a global DB =
connection<BR>&nbsp;$db =3D =0A=
TOOLS::PublicConnectDB-&gt;connect_to_db();<BR></FONT><FONT =
size=3D2>&nbsp;# =0A=
Authenticate<BR>&nbsp;auth_incoming_user();</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>&nbsp;# Determine what we want to do based =
on the =0A=
request<BR>&nbsp;# Most functions will return "OK" after the "display =
page" =0A=
subroutine<BR>&nbsp;# but for those that we have to redirect, the =
redirect =0A=
directive and the URL will be returned<BR>&nbsp;&nbsp;&nbsp; my =
$back_url =3D =0A=
"";<BR>&nbsp;my $request_type =3D "";<BR>&nbsp;($request_type,$back_url) =
=3D =0A=
determine_proper_action();<BR>&nbsp;<BR>&nbsp;# Properly Exit the =
Handler from =0A=
all subs within Determine Proper Action<BR>&nbsp;if ($request_type eq =0A=
'Apache::REDIRECT') {<BR>&nbsp;&nbsp;$r-&gt;headers_out-&gt;set(Location =
=3D&gt; =0A=
$back_url);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return =0A=
Apache::REDIRECT;<BR>&nbsp;} else {<BR>&nbsp;&nbsp;return =0A=
Apache::OK;<BR>&nbsp;}<BR>&nbsp;<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>&nbsp;</DIV>=0A=
<DIV dir=3Dltr>&lt;VirtualHost xxxx:80&gt;</DIV>=0A=
<DIV dir=3Dltr>.....</DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>PerlModule =
MALDEN::scripts::Index<BR>&lt;Location =0A=
"/index"&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SetHandler =0A=
perl-script<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PerlHandler =0A=
MALDEN::scripts::Index<BR>&lt;/Location&gt;</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>.....</FONT></DIV>=0A=
<DIV dir=3Dltr><FONT size=3D2>&lt;/VirtualHost&gt;</DIV></FONT></DIV>=0A=
=0A=
</BODY>=0A=
</HTML>
------_=_NextPart_001_01C4F767.D6A6198D--

MP2 - Make test Error - t/api/request_rec.t
Chris Faust 15:59 on 09 Jan 2005

Re: MP2 - Make test Error - t/api/request_rec.t
Stas Bekman 16:17 on 10 Jan 2005

RE: MP2 - Make test Error - t/api/request_rec.t
cfaust-dougot 18:33 on 10 Jan 2005

Re: MP2 - Make test Error - t/api/request_rec.t
Stas Bekman 22:25 on 10 Jan 2005

RE: MP2 - Make test Error - t/api/request_rec.t
cfaust-dougot 20:02 on 10 Jan 2005

Re: MP2 - Make test Error - t/api/request_rec.t
Stas Bekman 22:35 on 10 Jan 2005

RE: MP2 - Make test Error - t/api/request_rec.t
cfaust-dougot 22:58 on 10 Jan 2005

Re: MP2 - Make test Error - t/api/request_rec.t
Stas Bekman 23:16 on 10 Jan 2005

RE: MP2 - Make test Error - t/api/request_rec.t
cfaust-dougot 23:41 on 10 Jan 2005

Re: MP2 - Make test Error - t/api/request_rec.t
Stas Bekman 00:04 on 11 Jan 2005

RE: MP2 - Make test Error - t/api/request_rec.t
cfaust-dougot 00:25 on 11 Jan 2005

Generated at 12:39 on 05 Feb 2005 by mariachi v0.52