On Mon, 20 Sep 2004, Chris Hughes wrote:

>  I'm also not exactly sure why there are three checks (ie. that there is a
> cache object, that the cache object connection id is the same as the
> current, and then that the (altered) remote host name is the same in
> both).  I would have thought it would be enought to compare the
> connectionid, but this seems to stay the same between connections..?

 Apols to following up to myself, but I seem to have deleted Fred's email.
That patch didn't work (for me) as notes() expects an APR::Table object.
I've appended a patch that changes the way this works a little.  It seems
that all this trouble is just so that the AuthenNTLM module can tell if a
request comes from the same connection as the previous one (so it can
complete the NTLM 'hand-shake' or just Apache::OK if it has already been
successfully authenticated.

 So the below patch just pops a value into connection->notes() and checks
if it is there.   Would be interested in any comments.

 My question is why isn't the connection->id() used for this purpose?  It
loks like this value isn't unique between connections, so what does it do?

http://perl.apache.org/docs/2.0/api/Apache/Connection.html#C_id_

ta,

Chris


545,558c545,548
<     my $table = $conn->notes();
<     if (ref ($cache) ne $class || $$conn != $cache->{connectionid} ||
<       (!MP2 && $conn->remote_host ne $cache->{remote_host}) ||
<       (MP2 && $table->get('status') ne "AUTHSTARTED"))
<       {
<         if (!MP2) {
<           $conn->remote_host ($conn->remote_host . ' ');
<           $self = {connectionid => $$conn, remote_host => $conn -> remote_host} ;
<         } elsif (MP2) {
<           my $table = $conn->notes();
<           $table->add('status','AUTHSTARTED');
<           $conn->notes($table);
<           $self = {connectionid => $$conn } ;
<         }
---
>     if (ref ($cache) ne $class || $$conn != $cache -> {connectionid} || $conn -> 
> remote_host ne $cache->{remote_host})
>         {
>       $conn -> remote_host ($conn -> remote_host . ' ') ;
>         $self = {connectionid => $$conn, remote_host => $conn -> remote_host} ;


-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to