Skip to content

Commit

Permalink
combine close and error
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Dec 17, 2014
1 parent 90fd43f commit 6160782
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/Mojo/IOLoop/Stream.pm
Expand Up @@ -106,11 +106,8 @@ sub _read {
# Retry
return if $! == EAGAIN || $! == EINTR || $! == EWOULDBLOCK;

# Closed
return $self->close if $! == ECONNRESET;

# Error
$self->emit(error => $!)->close;
# Closed (maybe real error)
$! == ECONNRESET ? $self->close : $self->emit(error => $!)->close;
}

sub _write {
Expand Down

0 comments on commit 6160782

Please sign in to comment.