Skip to content

Instantly share code, notes, and snippets.

@kazeburo
Created May 30, 2012 01:06
Show Gist options
  • Select an option

  • Save kazeburo/2832003 to your computer and use it in GitHub Desktop.

Select an option

Save kazeburo/2832003 to your computer and use it in GitHub Desktop.
diff --git a/lib/Furl/HTTP.pm b/lib/Furl/HTTP.pm
index e859786..69a3c16 100644
--- a/lib/Furl/HTTP.pm
+++ b/lib/Furl/HTTP.pm
@@ -645,9 +645,12 @@ sub _read_body_chunked {
READ_CHUNK: while ( $next_len+2 > length($buf) ) {
my $n = $self->read_timeout( $sock,
\$buf, $self->{bufsize}, length($buf), $timeout_at );
- if ( not defined $n ) {
+ if (!$n) {
return $self->_r500(
- "Cannot read chunk: " . _strerror_or_timeout());
+ !defined($n)
+ ? "Cannot read chunk: " . _strerror_or_timeout()
+ : "Unexpected EOF while reading packets"
+ );
}
}
$$res_content .= substr($buf, 0, $next_len);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment