unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH 0/2] input_pipe-related fixes
@ 2024-07-03 10:52 Eric Wong
  2024-07-03 10:52 ` [PATCH 1/2] input_pipe: fstat(2) IO properly Eric Wong
  2024-07-03 10:52 ` [PATCH 2/2] qspawn: avoid redundantly setting O_NONBLOCK Eric Wong
  0 siblings, 2 replies; 3+ messages in thread
From: Eric Wong @ 2024-07-03 10:52 UTC (permalink / raw)
  To: meta

AFAIK these don't affect real-world code, but introducing
[2/2] would be a problem if the bug in [1/2] weren't fixed.

Eric Wong (2):
  input_pipe: fstat(2) IO properly
  qspawn: avoid redundantly setting O_NONBLOCK

 lib/PublicInbox/InputPipe.pm | 2 +-
 lib/PublicInbox/Qspawn.pm    | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] input_pipe: fstat(2) IO properly
  2024-07-03 10:52 [PATCH 0/2] input_pipe-related fixes Eric Wong
@ 2024-07-03 10:52 ` Eric Wong
  2024-07-03 10:52 ` [PATCH 2/2] qspawn: avoid redundantly setting O_NONBLOCK Eric Wong
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2024-07-03 10:52 UTC (permalink / raw)
  To: meta

We can't rely on `_' being set for all callers.  I'm not sure
if this was a problem before, but only noticed via manual code
inspection.
---
 lib/PublicInbox/InputPipe.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/PublicInbox/InputPipe.pm b/lib/PublicInbox/InputPipe.pm
index ee5bda59..77eae4ed 100644
--- a/lib/PublicInbox/InputPipe.pm
+++ b/lib/PublicInbox/InputPipe.pm
@@ -14,7 +14,7 @@ sub consume {
 	if ($@) { # regular file (but not w/ select|IO::Poll backends)
 		$self->{-need_rq} = 1;
 		$self->requeue;
-	} elsif (-p _ || -S _) { # O_NONBLOCK for sockets and pipes
+	} elsif (-p $in || -S _) { # O_NONBLOCK for sockets and pipes
 		$in->blocking(0);
 	}
 	$self;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] qspawn: avoid redundantly setting O_NONBLOCK
  2024-07-03 10:52 [PATCH 0/2] input_pipe-related fixes Eric Wong
  2024-07-03 10:52 ` [PATCH 1/2] input_pipe: fstat(2) IO properly Eric Wong
@ 2024-07-03 10:52 ` Eric Wong
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Wong @ 2024-07-03 10:52 UTC (permalink / raw)
  To: meta

PublicInbox::InputPipe::consume already sets it when it sees
a pipe or socket.
---
 lib/PublicInbox/Qspawn.pm | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/PublicInbox/Qspawn.pm b/lib/PublicInbox/Qspawn.pm
index 0bf857c6..cde45b42 100644
--- a/lib/PublicInbox/Qspawn.pm
+++ b/lib/PublicInbox/Qspawn.pm
@@ -245,7 +245,6 @@ sub _yield_start { # may run later, much later...
 	my ($self) = @_;
 	if ($self->{psgi_env}->{'pi-httpd.async'}) {
 		my $rpipe = $self->{rpipe};
-		$rpipe->blocking(0);
 		PublicInbox::InputPipe::consume($rpipe, \&ipipe_cb, $self);
 	} else {
 		require PublicInbox::GetlineResponse;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-03 10:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-07-03 10:52 [PATCH 0/2] input_pipe-related fixes Eric Wong
2024-07-03 10:52 ` [PATCH 1/2] input_pipe: fstat(2) IO properly Eric Wong
2024-07-03 10:52 ` [PATCH 2/2] qspawn: avoid redundantly setting O_NONBLOCK Eric Wong

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).