diff options
author | Eric Wong <e@80x24.org> | 2017-01-18 07:35:35 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2017-01-18 07:35:35 +0000 |
commit | f3416dbbc14b76235242c4937396438abc4d1c63 (patch) | |
tree | 772cd267335a39e33212971f919fc775a3adf7d9 /lib/PublicInbox/HTTP.pm | |
parent | 261182531d33e980e4316ca2a7b9ade603e85cf2 (diff) | |
download | public-inbox-f3416dbbc14b76235242c4937396438abc4d1c63.tar.gz |
We can more effectly nuke circular references by clearing the entire PSGI $env, not just particular keys, when there are self-referential fields such as "qspawn.response" in our environment.
Diffstat (limited to 'lib/PublicInbox/HTTP.pm')
-rw-r--r-- | lib/PublicInbox/HTTP.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index 3530f8ba..8ba41ba5 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -241,6 +241,7 @@ sub response_done_cb ($$) { sub { my $env = $self->{env}; $self->{env} = undef; + %$env = () if $env; # prevent circular references $self->write("0\r\n\r\n") if $alive == 2; $self->write(sub{$alive ? next_request($self) : $self->close}); } @@ -472,7 +473,7 @@ sub close { my $self = shift; my $forward = $self->{forward}; my $env = $self->{env}; - delete $env->{'psgix.io'} if $env; # prevent circular references + %$env = () if $env; # prevent circular references $self->{pull} = $self->{forward} = $self->{env} = undef; if ($forward) { eval { $forward->close }; |