Upon further investigation (ok, trial and error...), it seems that using
the multipart form encoding, in conjunction with CGI.pm (I'm using
CGI.pm-2.49) and Apache::Session, causes my test script to hang
at the "op" function within the IPC modules.

In the same test script, if I use the Apache::Request object instead of
the CGI object, the script runs fine, and Apache::Session works fine
(with either form of encoding).

I will be upgrading CGI to the lastest rev to see if that fixes things.  

--kip


On: Thu, 21 Oct 1999 19:20:13 EDT
Kip Cranford wrote:
>
>Thanks for the reply, Jeffrey.
>
>Ok, I can understand how leaking session handles would cause a read or
>write lock, or whatever.   However, I thought that untieing the session
>hash would release whatever locks the session held -- at the end of the
>simple script I untie the hash.
>
>In fact, the script is so simple I don't see where I could be leaking
>the handles (but just because _I_ can't see where doesn't mean a whole
>lot :)
>
>And finally, to add to my confusion, I can take the test script, change
>the form encoding from multipart to x-www-form-urlencoded, and have it
>work fine.  Change it back to multipart, and it hangs.  Any idea there??
>
>Thanks for your attention,
>
>--kip 
>
>p.s. I'm including the test script at the end of this message -- there's
>probably something obviously wrong that I just can't see...
>
>
>>
>>The problem is that you are leaking session handles.  For
>>Apache::Session to work, there must be zero references to the session
>>hash at the end of the request.
>>
>>-jwb
>>-- 
>>Jeffrey W. Baker * [EMAIL PROTECTED]
>>Critical Path, Inc. * we handle the world's email * www.cp.net
>>415.808.8807
>>
>
>
>============
>Test Script
>============
>     
>use strict;
>use Apache ();
>use Apache::Constants qw( :common );
>use Apache::Session::DBI;
>use CGI();
>
>sub handler {
>       my $r = shift;
>
>       $r->send_http_header("text/html");
>       
>       my $session_id = CGI::param('session') || undef;
>       
>       my %session;
>       my $opts = {
>                                       DataSource  => 'dbi:mysql:sessions',
>                                       UserName    => 'nobody',
>                                       Password    => '',
>                               };
>
>       tie %session, 'Apache::Session::DBI', $session_id, $opts;
>
>       my $file = CGI::param('upload');
>       if ($file) {
>               $session{'file'} = $file;
>       }
>       
>       print<<__EOS__;
>
>Apache::Session Test Script<br>
>Session ID number is: $session{_session_id}<br>
>Storing file: $file<br>
><br>
>
><form action="http://xxx/secure" enctype="multipart/form-data" method="post">
><!--form action="http://xxx/secure"  method="post"-->
>  Type in your name here:
>  <input type="file" name="upload"><br>
>  <input type="submit" value="Go!">
>  <input type="hidden" name="session" value="$session{_session_id}">
></form>
>__EOS__
>print "untieing the session...<br>";
>untie %session;
>}
>
>1;
>
>===============
>End Test Script
>===============

Reply via email to