Changeset 766 for trunk/lib/Perlbal/ClientProxy.pm
- Timestamp:
- 03/09/08 03:58:16 (21 months ago)
- Files:
-
- 1 modified
-
trunk/lib/Perlbal/ClientProxy.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/Perlbal/ClientProxy.pm
r763 r766 1021 1021 # reset our position so we start reading from the right spot 1022 1022 $self->{buoutpos} = 0; 1023 sysseek($self->{bufh}, 0, 0) ;1023 sysseek($self->{bufh}, 0, 0) if ($self->{bufh}); # But only if it exists at all 1024 1024 1025 1025 # notify that we want the backend so we get the ball rolling … … 1035 1035 my $clen = $self->{request_body_length}; 1036 1036 1037 my $sent = Perlbal::Socket::sendfile($be->{fd}, fileno($self->{bufh}), $clen - $self->{buoutpos}); 1038 if ($sent < 0) { 1039 return $self->close("epipe") if $! == EPIPE; 1040 return $self->close("connreset") if $! == ECONNRESET; 1041 print STDERR "Error w/ sendfile: $!\n"; 1042 return $self->close('sendfile_error'); 1043 } 1044 $self->{buoutpos} += $sent; 1037 if ($self->{buoutpos} < $clen) { 1038 my $sent = Perlbal::Socket::sendfile($be->{fd}, fileno($self->{bufh}), $clen - $self->{buoutpos}); 1039 if ($sent < 0) { 1040 return $self->close("epipe") if $! == EPIPE; 1041 return $self->close("connreset") if $! == ECONNRESET; 1042 print STDERR "Error w/ sendfile: $!\n"; 1043 return $self->close('sendfile_error'); 1044 } 1045 $self->{buoutpos} += $sent; 1046 } 1045 1047 1046 1048 # if we're done, purge the file and move on … … 1155 1157 sub purge_buffered_upload { 1156 1158 my Perlbal::ClientProxy $self = shift; 1159 1160 # Main reason for failure below is a 0-length chunked upload, where the file is never created. 1161 return unless $self->{bufh}; 1157 1162 1158 1163 # FIXME: it's reported that sometimes the two now-in-eval blocks
