File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -223,7 +223,7 @@ sub drop {
223223 my ($self ,$id ,$err ) = @_ ;
224224 $err =~ s /\015 // sg ;
225225 # warn "Dropping connection $id: $err (by request from @{[ (caller)[1,2] ]})";# if DEBUG or $self->{debug};
226- my $r = delete $self -> {$id };
226+ my $r = delete $self -> {$id } or return ;
227227 $self -> {active_connections }--;
228228 %{ $r } = () if $r ;
229229
@@ -564,17 +564,16 @@ sub incoming {
564564 $h -> on_drain(sub {
565565 $h -> destroy;
566566 undef $h ;
567- $self -> drop($id ) if $self ;
568567 });
569568 undef $h ;
570569 }
571- else {
572- $self -> drop($id ) if $self ;
573- }
574570 }
575571 });
576572 $req -> handle($h );
577573 $rv [1]-> ($h );
574+ $h -> {__cnn_drop_guard } = guard {
575+ $self -> drop($id ) if $self ;
576+ };
578577 weaken($req );
579578 %r = ( );
580579 return ;
Original file line number Diff line number Diff line change @@ -540,6 +540,11 @@ BEGIN {
540540 }
541541 elsif (defined $self -> {chunked }) {
542542 ${ $self -> {reqcount } }--;
543+ # warn "sent body with non-chunked (wr=$self->{writer}) (".$self->connection.")\n";
544+ if ( $self -> {writer } ) {
545+ $self -> {writer }-> (\undef ) if $self -> connection eq ' close' or $self -> server-> {graceful };
546+ delete $self -> {writer };
547+ }
543548 undef $self -> {chunked };
544549 }
545550 else {
You can’t perform that action at this time.
0 commit comments