perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@hyperreal.org
Subject cvs commit: modperl/t/net/perl request-upload.pl
Date Wed, 30 Dec 1998 20:50:34 GMT
dougm       98/12/30 12:50:34

  Modified:    t/net/perl request-upload.pl
  Log:
  a few upload test tweaks
  
  Revision  Changes    Path
  1.7       +13 -4     modperl/t/net/perl/request-upload.pl
  
  Index: request-upload.pl
  ===================================================================
  RCS file: /home/cvs/modperl/t/net/perl/request-upload.pl,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- request-upload.pl	1998/12/30 03:29:00	1.6
  +++ request-upload.pl	1998/12/30 20:50:32	1.7
  @@ -27,6 +27,8 @@
       my $filename = $upload->filename;
       my $name = $upload->name;
       my $type = $upload->type;
  +    next unless $filename;
  +
       print "$name $filename ($type)";
       if ($fh and $name) {
   	no strict;
  @@ -35,17 +37,23 @@
   	}
       }
       print "\n";
  +    close $fh;
   }
   
   my $first = $apr->upload->name;
   my $first_filename = $apr->upload->filename;
   my $first_fh = $apr->upload->fh;
  -while (<$first_fh>) { }
  +if ($first_fh) {
  +    while (<$first_fh>) { }
  +}
  +close $first_fh;
   
   for my $upload ($apr->upload) {
       my $fh = $upload->fh;
       my $filename = $upload->filename;
       my $name = $upload->name;
  +    next unless $filename;
  +
       my($lines, $bytes);
       $lines = $bytes = 0;
   
  @@ -70,7 +78,8 @@
   	$bytes += length;
   	print OUT $_ if fileno OUT;
       }
  -    close OUT;
  +    close OUT if fileno OUT;
  +    close $fh;
   
       my $info = $upload->info;
       while (my($k,$v) = each %$info) {
  @@ -83,9 +92,9 @@
   	while (my($k,$v) = each %$info) {
   	    print "INFO: $k => $v\n";
   	}
  -	my $type = $apr->uploadInfo($first_filename, "content-type");
  +	my $type = $apr->upload($first)->info("content-type");
   	unless ($type) {
  -	    die "uploadInfo is broken";
  +	    die "upload->info is broken";
   	} 
   	print "TYPE: $type\n";
   	print "-" x 40, $/;
  
  
  

Mime
View raw message