From 8e85257577ee4d7d49e59f048852d9d4ac6f8172 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 7 Jul 2016 01:39:36 +0000 Subject: inbox: cleanup and consolidate object weakening This fixes some layering violations and consolidates the cleanup into the inbox object itself. Keeping in mind weakening does not work at all without our PSGI server. --- lib/PublicInbox/HTTP.pm | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'lib/PublicInbox/HTTP.pm') diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm index e19c592c..abf648f9 100644 --- a/lib/PublicInbox/HTTP.pm +++ b/lib/PublicInbox/HTTP.pm @@ -25,15 +25,6 @@ use constant { CHUNK_MAX_HDR => 256, }; -# FIXME: duplicated code with NNTP.pm, layering violation -my $WEAKEN = {}; # string(inbox) -> inbox -my $weakt; -sub weaken_task () { - $weakt = undef; - $_->weaken_all for values %$WEAKEN; - $WEAKEN = {}; -} - my $pipelineq = []; my $pipet; sub process_pipelineq () { @@ -252,13 +243,6 @@ sub response_done ($$) { $self->{env} = undef; $self->write("0\r\n\r\n") if $alive == 2; $self->write(sub { $alive ? next_request($self) : $self->close }); - - # FIXME: layering violation - if (my $obj = $env->{'pi-httpd.inbox'}) { - # grace period for reaping resources - $WEAKEN->{"$obj"} = $obj; - PublicInbox::EvCleanup::later(*weaken_task); - } } sub getline_response { -- cgit v1.2.3-24-ge0c7