Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 280497 | Differences between
and this patch

Collapse All | Expand All

(-)lib/Net/FTPServer.pm.orig (-17 / +17 lines)
Lines 4228-4234 Link Here
4228
4228
4229
		 $zip->addMember ($memb);
4229
		 $zip->addMember ($memb);
4230
		 $memb->desiredCompressionMethod
4230
		 $memb->desiredCompressionMethod
4231
		   (&{$ {Archive::Zip::}{COMPRESSION_DEFLATED}});
4231
		   (&Archive::Zip::COMPRESSION_DEFLATED);
4232
		 $memb->desiredCompressionLevel (9);
4232
		 $memb->desiredCompressionLevel (9);
4233
	       }
4233
	       }
4234
	 },
4234
	 },
Lines 4260-4266 Link Here
4260
	if ($file)
4260
	if ($file)
4261
	  {
4261
	  {
4262
	    unlink $tmpname;
4262
	    unlink $tmpname;
4263
	    $zip->writeToFileHandle ($file, 1) == &{$ {Archive::Zip::}{AZ_OK}}
4263
	    $zip->writeToFileHandle ($file, 1) == &Archive::Zip::AZ_OK
4264
	      or die "failed to write to zip file: $!";
4264
	      or die "failed to write to zip file: $!";
4265
	    $file->seek (0, 0);
4265
	    $file->seek (0, 0);
4266
	  }
4266
	  }
Lines 4269-4275 Link Here
4269
    unless ($file)
4269
    unless ($file)
4270
      {
4270
      {
4271
	$file = new IO::Scalar;
4271
	$file = new IO::Scalar;
4272
	$zip->writeToFileHandle ($file, 1) == &{$ {Archive::Zip::}{AZ_OK}}
4272
	$zip->writeToFileHandle ($file, 1) == &Archive::Zip::AZ_OK
4273
	  or die "failed to write to zip file: $!";
4273
	  or die "failed to write to zip file: $!";
4274
	$file->seek (0, 0);
4274
	$file->seek (0, 0);
4275
      }
4275
      }
Lines 8109-8122 Link Here
8109
    $self->fileName ($filename);
8109
    $self->fileName ($filename);
8110
    $self->{externalFileName} = $filename;
8110
    $self->{externalFileName} = $filename;
8111
8111
8112
    $self->{compressionMethod} = &{$ {Archive::Zip::}{COMPRESSION_STORED}};
8112
    $self->{compressionMethod} = "Archive::Zip::COMPRESSION_STORED";
8113
8113
8114
    my ($mode, $perms, $nlink, $user, $group, $size, $time) = $fileh->status;
8114
    my ($mode, $perms, $nlink, $user, $group, $size, $time) = $fileh->status;
8115
    $self->{compressedSize} = $self->{uncompressedSize} = $size;
8115
    $self->{compressedSize} = $self->{uncompressedSize} = $size;
8116
    $self->desiredCompressionMethod
8116
    $self->desiredCompressionMethod
8117
      ($self->compressedSize > 0
8117
      ($self->compressedSize > 0
8118
       ? &{$ {Archive::Zip::}{COMPRESSION_DEFLATED}}
8118
       ? &Archive::Zip::COMPRESSION_DEFLATED
8119
       : &{$ {Archive::Zip::}{COMPRESSION_STORED}});
8119
       : &Archive::Zip::COMPRESSION_STORED);
8120
    $self->unixFileAttributes ($perms);
8120
    $self->unixFileAttributes ($perms);
8121
    $self->setLastModFileDateTimeFromUnix ($time);
8121
    $self->setLastModFileDateTimeFromUnix ($time);
8122
    $self->isTextFile (0);
8122
    $self->isTextFile (0);
Lines 8136-8142 Link Here
8136
    return $self->{fh} if $self->{fh};
8136
    return $self->{fh} if $self->{fh};
8137
8137
8138
    $self->{fh} = $self->{fileh}->open ("r")
8138
    $self->{fh} = $self->{fileh}->open ("r")
8139
      or return &{$ {Archive::Zip::}{AZ_IO_ERROR}};
8139
      or return &Archive::Zip::AZ_IO_ERROR;
8140
8140
8141
    $self->{fh};
8141
    $self->{fh};
8142
  }
8142
  }
Lines 8146-8162 Link Here
8146
    my $self = shift;
8146
    my $self = shift;
8147
8147
8148
    my $status = $self->SUPER::rewindData (@_);
8148
    my $status = $self->SUPER::rewindData (@_);
8149
    return $status if $status != &{$ {Archive::Zip::}{AZ_OK}};
8149
    return $status if $status != &Archive::Zip::AZ_OK;
8150
8150
8151
    return &{$ {Archive::Zip::}{AZ_IO_ERROR}} unless $self->fh;
8151
    return &Archive::Zip::AZ_IO_ERROR unless $self->fh;
8152
8152
8153
    # Not all personalities can seek backwards in the stream. Close
8153
    # Not all personalities can seek backwards in the stream. Close
8154
    # the file and reopen it instead.
8154
    # the file and reopen it instead.
8155
    $self->endRead == &{$ {Archive::Zip::}{AZ_OK}}
8155
    $self->endRead == &Archive::Zip::AZ_OK
8156
      or return &{$ {Archive::Zip::}{AZ_IO_ERROR}};
8156
      or return &Archive::Zip::AZ_IO_ERROR;
8157
    $self->fh;
8157
    $self->fh;
8158
8158
8159
    return &{$ {Archive::Zip::}{AZ_OK}};
8159
    return &Archive::Zip::AZ_OK;
8160
  }
8160
  }
8161
8161
8162
sub _readRawChunk
8162
sub _readRawChunk
Lines 8165-8176 Link Here
8165
    my $dataref = shift;
8165
    my $dataref = shift;
8166
    my $chunksize = shift;
8166
    my $chunksize = shift;
8167
8167
8168
    return (0, &{$ {Archive::Zip::}{AZ_OK}}) unless $chunksize;
8168
    return (0, &Archive::Zip::AZ_OK) unless $chunksize;
8169
8169
8170
    my $bytesread = $self->fh->sysread ($$dataref, $chunksize)
8170
    my $bytesread = $self->fh->sysread ($$dataref, $chunksize)
8171
      or return (0, &{$ {Archive::Zip::}{AZ_IO_ERROR}});
8171
      or return (0, &Archive::Zip::AZ_IO_ERROR);
8172
8172
8173
    return ($bytesread, &{$ {Archive::Zip::}{AZ_OK}});
8173
    return ($bytesread, &Archive::Zip::AZ_OK);
8174
  }
8174
  }
8175
8175
8176
sub endRead
8176
sub endRead
Lines 8180-8189 Link Here
8180
    if ($self->{fh})
8180
    if ($self->{fh})
8181
      {
8181
      {
8182
	$self->{fh}->close
8182
	$self->{fh}->close
8183
	  or return &{$ {Archive::Zip::}{AZ_IO_ERROR}};
8183
	  or return &Archive::Zip::AZ_IO_ERROR;
8184
	delete $self->{fh};
8184
	delete $self->{fh};
8185
      }
8185
      }
8186
    return &{$ {Archive::Zip::}{AZ_OK}};
8186
    return &Archive::Zip::AZ_OK;
8187
  }
8187
  }
8188
8188
8189
1 # So that the require or use succeeds.
8189
1 # So that the require or use succeeds.

Return to bug 280497