Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed big memory and file descriptor leak in the TLS code of Mojo::IO…
…Loop::Server
  • Loading branch information
kraih committed Oct 7, 2011
1 parent 041c5f3 commit 4ca8635
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Changes
@@ -1,6 +1,6 @@
This file documents the revision history for Perl extension Mojolicious.

2.0 2011-10-07 00:00:00
2.0 2011-10-08 00:00:00
- Code name "Leaf Fluttering In Wind", this is a major release.
- Increased Perl version requirement to 5.10.1.
- Added EXPERIMENTAL on_body attribute to Mojo::Content.
Expand All @@ -12,6 +12,8 @@ This file documents the revision history for Perl extension Mojolicious.
- Improved tests.
- Fixed many portability issues.
- Fixed on_finish callback to work consistently with all servers.
- Fixed big memory and file descriptor leak in the TLS code of
Mojo::IOLoop::Server.
- Fixed small memory leak in Mojo::DOM.
- Fixed small memory leak in Mojo::Message.
- Fixed small formatting bug in Mojo::Headers.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/IOLoop/Server.pm
Expand Up @@ -189,7 +189,7 @@ sub _accept {
return $self->emit(accept => $handle) unless my $tls = $self->{tls};
weaken $self;
$tls->{SSL_error_trap} = sub {
my $handle = delete $self->{handles}->{$handle};
my $handle = delete $self->{handles}->{shift()};
$self->iowatcher->remove($handle);
close $handle;
};
Expand Down
4 changes: 3 additions & 1 deletion lib/Mojo/IOLoop/Stream.pm
Expand Up @@ -18,7 +18,9 @@ has iowatcher => sub {
sub DESTROY {
my $self = shift;
$self->pause if $self->{iowatcher};
$self->emit('close') if $self->{handle};
return unless my $handle = $self->{handle};
close $handle;
$self->emit('close');
}

sub new {
Expand Down

0 comments on commit 4ca8635

Please sign in to comment.