randyk      2004/07/03 21:32:29

  Modified:    glue/perl/t/response/TestApReq request.pm
  Log:
  Reviewed by:  joes
  use APR::PerlIO's open, rather than Perl's open, in opening
  $upload->tempname. This makes a difference on Win32 - the temporary
  file is created with APR_DELONCLOSE to delete the file upon
  closing, and if Perl's open() is used, the temp file gets
  deleted before open() can read it.
  
  Revision  Changes    Path
  1.18      +5 -1      httpd-apreq-2/glue/perl/t/response/TestApReq/request.pm
  
  Index: request.pm
  ===================================================================
  RCS file: /home/cvs/httpd-apreq-2/glue/perl/t/response/TestApReq/request.pm,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- request.pm        2 Jul 2004 20:50:16 -0000       1.17
  +++ request.pm        4 Jul 2004 04:32:29 -0000       1.18
  @@ -8,6 +8,10 @@
   use Apache::Request ();
   use Apache::Connection;
   use Apache::Upload;
  +use APR::Pool;
  +use APR::PerlIO;
  +
  +my $p = APR::Pool->new();
   
   sub handler {
       my $r = shift;
  @@ -62,7 +66,7 @@
       }
       elsif ($test eq 'tempname') {
           my $upload = $req->upload("HTTPUPLOAD");
  -        open my $fh, "<", $upload->tempname or die $!;
  +        open my $fh, "<:APR", $upload->tempname, $p or die $!;
           $r->print(<$fh>);
       }
       elsif ($test eq 'bad') {
  
  
  

Reply via email to