RE: Translation handler continuous loop problem

2001-02-01 Thread Sinclair, Alan (CORP, GEAccess)

This is a repost because my earlier message from this morning bounced. Since
then I feel we have located the source of the problem. It looks like there
is a most bizarre interaction between Netscape clients and the proxy server.
Netscape was configured with manual proxy settings identifying the web
server with Apache/mod_perl.  Once this was done, Netscape is able to
successfully connect to Apache/mod_perl with no more continuous loops!!  I
don't know the whys or hows.


The following text is a copy of what I posted this morning.

Thanks for the example. I inserted the statement "return DECLINED unless
$r-is_initial_req;"  but the handler still enters a continuous loop.  I
also stripped out my code and tried the example from Doug's module book with
debug statements but still a continuous loop. The problem is bizarre. It
only enters the loop for a URL like http://lions/sp9/whatever  Any other URL
such as http://lions/here/there works fine. I wrote the original handler to
extract a session id from a URL with sp9 in the path but now there is no
reference. I have checked my httpd.conf for anything out of ordinary as
well. As can be seen, the translation handler below is very very basic but
it still enters a continuous loop for that specific URL. If I place a fully
qualified donamin name like http://lions.access.com/sp9/whatever, there is
no loop!!  

Any ideas?

package Apache::URIsid;
use strict;
use Apache::Constants qw(:common);
use CGI::Carp;

sub handler {
  my $r = shift;

  return DECLINED unless $r-is_initial_req;
  my($junk,$session,@rest) = split '/', $r-uri;
#  warn "junk: $junk";
#  warn "session: $session";
#  foreach (@rest) {
#warn "rest: $_";
#  }

  my $uri = $r-uri;
  warn "URI in: $uri";
  return DECLINED;

#  my $uri_in = $r-uri;
#  warn "sp9 URL detected $uri_in"; 
#  $r-subprocess_env('SESSION_ID' = $session); 
#  my $translated_uri = join "/", "",@rest;
#  $r-uri($translated_uri);
#  return DECLINED;
}
1;
__END__



-Original Message-
From: Greg Cope [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 31, 2001 5:47 PM
To: Sinclair, Alan (CORP, GEAccess)
Cc: '[EMAIL PROTECTED]'
Subject: Re: Translation handler continuous loop problem


"Sinclair, Alan (CORP, GEAccess)" wrote:
 
 I am hoping someone might have a clue on how to resolve this awkward
 problem.
 
 I have just installed a mod_perl URI translation handler to extract a
 session id from the URI. In general the translation works correctly by
 removing the session id from the URL when detected. However, a Netscape
 browser client triggers Apache to enter a continuous loop if I do not
 specify the domain name in the hostname component of the URL. The problem
 does not occur in Internet Explorer (that surprised me.)
 
 All these examples are from Nestcape on both NT and Unix.
 For example, say I enter http://lions.access.com/sp9/outage.html  The
 translation handler works correctly.
 If I then enter: http://lions/sp9/outage.html  There is a continuous loop
in
 Apache and on each iteration, an entry is written to access_log. I have to
 stop the request in Netscape.
 
 The bizarre thing is I can enter any other URL such as
 http://lions/internal/whatever and there is no problem. The mod_perl
 translation header goal is stripping session id info from the URL in the
 form http://hostname/SESSION_ID/sp9/whatever It looks for sp9 in the path.
I
 have attempted to debug by trying to send error messages to the error log
 without success.
 
 Does anyone have any suggestions on how I can determine why the
translation
 handler is entering into a continuous loop when a request is sent from
 Netscape?
 
 I would be appreciative of any help!!

I could be completely wrong but ...

I can't see a problem here - although I would need to see the code.

There could be an issue with how IE and Netscape actually format the
header (i.e you may enter the above, but the header that gets sent may
be different) - but I could be completely wrong on this !

You may wish to look at http://sourceforge.net/projects/sessionmanager/

Which is URI transhandler / session manager that I wrote for a project
that never came about.  I may make another release that uses PerlSetVars
to configure the module if I get a chance to test it.

If this does not help, then post either the code, or a URL to the code
if its long, so that some of us can have a look.

Greg

 
 Env is: Solaris 2.6  Apache 1.3.14  mod_perl 1.24_01



Re: Translation handler continuous loop problem

2001-01-31 Thread ___cliff rayman___

you will probably need to post the handler if you want any help
with it.

"Sinclair, Alan (CORP, GEAccess)" wrote:


 I have just installed a mod_perl URI translation handler to extract a
 session id from the URI. In general the translation works correctly by
 removing the session id from the URL when detected. However, a Netscape
 browser client triggers Apache to enter a continuous loop if I do not
 specify the domain name in the hostname component of the URL. The problem
 does not occur in Internet Explorer (that surprised me.)

 All these examples are from Nestcape on both NT and Unix.
 For example, say I enter http://lions.access.com/sp9/outage.html  The
 translation handler works correctly.
 If I then enter: http://lions/sp9/outage.html  There is a continuous loop in
 Apache and on each iteration, an entry is written to access_log. I have to
 stop the request in Netscape.


--
___cliff [EMAIL PROTECTED]http://www.genwax.com/





Re: Translation handler continuous loop problem

2001-01-31 Thread Greg Cope

"Sinclair, Alan (CORP, GEAccess)" wrote:
 
 I am hoping someone might have a clue on how to resolve this awkward
 problem.
 
 I have just installed a mod_perl URI translation handler to extract a
 session id from the URI. In general the translation works correctly by
 removing the session id from the URL when detected. However, a Netscape
 browser client triggers Apache to enter a continuous loop if I do not
 specify the domain name in the hostname component of the URL. The problem
 does not occur in Internet Explorer (that surprised me.)
 
 All these examples are from Nestcape on both NT and Unix.
 For example, say I enter http://lions.access.com/sp9/outage.html  The
 translation handler works correctly.
 If I then enter: http://lions/sp9/outage.html  There is a continuous loop in
 Apache and on each iteration, an entry is written to access_log. I have to
 stop the request in Netscape.
 
 The bizarre thing is I can enter any other URL such as
 http://lions/internal/whatever and there is no problem. The mod_perl
 translation header goal is stripping session id info from the URL in the
 form http://hostname/SESSION_ID/sp9/whatever It looks for sp9 in the path. I
 have attempted to debug by trying to send error messages to the error log
 without success.
 
 Does anyone have any suggestions on how I can determine why the translation
 handler is entering into a continuous loop when a request is sent from
 Netscape?
 
 I would be appreciative of any help!!

I could be completely wrong but ...

I can't see a problem here - although I would need to see the code.

There could be an issue with how IE and Netscape actually format the
header (i.e you may enter the above, but the header that gets sent may
be different) - but I could be completely wrong on this !

You may wish to look at http://sourceforge.net/projects/sessionmanager/

Which is URI transhandler / session manager that I wrote for a project
that never came about.  I may make another release that uses PerlSetVars
to configure the module if I get a chance to test it.

If this does not help, then post either the code, or a URL to the code
if its long, so that some of us can have a look.

Greg

 
 Env is: Solaris 2.6  Apache 1.3.14  mod_perl 1.24_01