Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
no need to assign the transaction twice
  • Loading branch information
kraih committed Jan 9, 2016
1 parent 219f612 commit c319e7d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/Mojo/Server/Daemon.pm
Expand Up @@ -123,10 +123,9 @@ sub _finish {

# Upgrade connection to WebSocket
if (my $ws = $c->{tx} = $tx->next) {
$c->{tx} = $ws->handshake($tx->next(undef));

# Successful upgrade
if ($ws->res->code == 101) {
if ($ws->handshake($tx->next(undef))->res->code == 101) {
weaken $self;
$ws->on(resume => sub { $self->_write($id) });
$ws->server_open;
Expand Down

0 comments on commit c319e7d

Please sign in to comment.