Skip to content

Commit

Permalink
these checks do not actually serve a purpose
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 11, 2016
1 parent 6e729ea commit c697b50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Mojo/Transaction/HTTP.pm
Expand Up @@ -90,7 +90,7 @@ sub _body {
if (defined $buffer) { delete $self->{delay} }

# Delayed
elsif (delete $self->{delay}) { $self->{state} = 'paused' }
elsif (delete $self->{delay}) { $self->{state} = 'read' }
else { $self->{delay} = 1 }

# Finished
Expand Down
6 changes: 2 additions & 4 deletions lib/Mojo/UserAgent.pm
Expand Up @@ -252,8 +252,7 @@ sub _read {
# Process incoming data
warn term_escape "-- Client <<< Server (@{[_url($tx)]})\n$chunk\n" if DEBUG;
$tx->client_read($chunk);
if ($tx->is_finished) { $self->_finish($id) }
elsif ($tx->is_writing) { $self->_write($id) }
$self->_finish($id) if $tx->is_finished;
}

sub _redirect {
Expand Down Expand Up @@ -317,8 +316,7 @@ sub _write {

# Get and write chunk
my $c = $self->{connections}{$id};
return unless my $tx = $c->{tx};
return if !$tx->is_writing || $c->{writing}++;
return if $c->{writing}++ || !(my $tx = $c->{tx});
my $chunk = $tx->client_write;
delete $c->{writing};
warn term_escape "-- Client >>> Server (@{[_url($tx)]})\n$chunk\n" if DEBUG;
Expand Down

0 comments on commit c697b50

Please sign in to comment.