Skip to content

Commit

Permalink
fixed small drain event bug in Mojo::IOLoop::Stream (closes #491)
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 19, 2013
1 parent d1e9066 commit 565d075
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,5 +1,6 @@

4.01 2013-05-18
- Fixed small drain event bug in Mojo::IOLoop::Stream.

4.0 2013-05-15
- Code name "Top Hat", this is a major release.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojo/IOLoop/Stream.pm
Expand Up @@ -41,7 +41,7 @@ sub is_readable {

sub is_writing {
my $self = shift;
return undef unless exists $self->{handle};
return undef unless $self->{handle};
return !!length($self->{buffer}) || $self->has_subscribers('drain');
}

Expand Down Expand Up @@ -132,7 +132,7 @@ sub _write {
}

$self->emit_safe('drain') unless length $self->{buffer};
return if $self->is_writing;
return if !$self->{handle} || $self->is_writing;
return $self->close if $self->{graceful};
$self->reactor->watch($handle, !$self->{paused}, 0);
}
Expand Down

0 comments on commit 565d075

Please sign in to comment.