user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 6/6] http: remove unnecessary delete
  2019-09-17  8:31  6% [PATCH 0/6] qspawn-related cleanups, comments, and minor fix Eric Wong
@ 2019-09-17  8:31  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2019-09-17  8:31 UTC (permalink / raw)
  To: meta

Only removing $http->{env} is needed to prevent circular
references.  $env->{'psgix.io'} does not need to be deleted
since $env will no longer have any references to it when
->close returns.
---
 lib/PublicInbox/HTTP.pm | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/PublicInbox/HTTP.pm b/lib/PublicInbox/HTTP.pm
index cd95f4a..009b5ff 100644
--- a/lib/PublicInbox/HTTP.pm
+++ b/lib/PublicInbox/HTTP.pm
@@ -453,9 +453,7 @@ sub quit {
 
 sub close {
 	my $self = $_[0];
-	if (my $env = delete $self->{env}) {
-		delete $env->{'psgix.io'}; # prevent circular references
-	}
+	delete $self->{env}; # prevent circular references
 	if (my $forward = delete $self->{forward}) {
 		eval { $forward->close };
 		err($self, "forward ->close error: $@") if $@;
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/6] qspawn-related cleanups, comments, and minor fix
@ 2019-09-17  8:31  6% Eric Wong
  2019-09-17  8:31  7% ` [PATCH 6/6] http: remove unnecessary delete Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2019-09-17  8:31 UTC (permalink / raw)
  To: meta

Still haven't found anything which is causing problems on korg,
but found a bunch of worthwhile cleanups, clarifications
and perhaps minor efficiency improvements that I'm comfortable
putting on 'master'.

Eric Wong (6):
  qspawn: remove return value from ->finish
  qspawn: log errors for generic PSGI server users
  qspawn: shorten lifetime of circular references
  qspawn: improve variable naming and commenting
  http: drop unused `$env' variable after delete
  http: remove unnecessary delete

 lib/PublicInbox/GitHTTPBackend.pm |  2 +-
 lib/PublicInbox/HTTP.pm           |  6 ++--
 lib/PublicInbox/Qspawn.pm         | 48 ++++++++++++-------------------
 t/qspawn.t                        | 17 +++++++----
 4 files changed, 33 insertions(+), 40 deletions(-)

-- 
EW


^ permalink raw reply	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-09-17  8:31  6% [PATCH 0/6] qspawn-related cleanups, comments, and minor fix Eric Wong
2019-09-17  8:31  7% ` [PATCH 6/6] http: remove unnecessary delete Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).