unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 3/3] ds: long_step: eliminate redundant fileno call
Date: Sat, 25 Nov 2023 20:54:35 +0000	[thread overview]
Message-ID: <20231125205435.4187895-4-e@80x24.org> (raw)
In-Reply-To: <20231125205435.4187895-1-e@80x24.org>

We already stash the associated FD for reporting at startup and
don't need to call `fileno' again.  Found via manual code
inspection while considering the effort to make async {forward}
from PublicInbox::HTTP more like the generic long_response API
and {long_cb} field used by IMAP/NNTP/POP3.
---
 lib/PublicInbox/DS.pm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm
index 4c8b502f..8bc8cfb7 100644
--- a/lib/PublicInbox/DS.pm
+++ b/lib/PublicInbox/DS.pm
@@ -629,7 +629,6 @@ sub long_step {
 		delete $self->{long_cb};
 		$self->long_response_done;
 		my $elapsed = now() - $t0;
-		my $fd = fileno($self->{sock});
 		$self->out(" deferred[$fd] done - %0.6f", $elapsed);
 		my $wbuf = $self->{wbuf}; # do NOT autovivify
 		requeue($self) unless $wbuf && @$wbuf;

      parent reply	other threads:[~2023-11-25 20:54 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-25 20:54 [PATCH 0/3] ds: event loop-related fixes Eric Wong
2023-11-25 20:54 ` [PATCH 1/3] http: fix pipelining during long async requests Eric Wong
2023-11-25 20:54 ` [PATCH 2/3] select+poll: have caller retry on EINTR Eric Wong
2023-11-25 20:54 ` Eric Wong [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231125205435.4187895-4-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).