From 89e75b356ba23eb3fea488a86d4850ae486a32c6 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 28 Apr 2021 07:51:59 +0000 Subject: [PATCH] lei-daemon: note FD count mismatch to client This should help in some error diagnostics --- lib/PublicInbox/LEI.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index ef72758c..a949ae3e 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -998,7 +998,7 @@ sub accept_dispatch { # Listener {post_accept} callback open($self->{$i++}, '+<&=', $fd) and next; send($sock, "open(+<&=$fd) (FD=$i): $!", MSG_EOR); } - return if scalar(@fds) != 4; + $i == 4 or return send($sock, 'not enough FDs='.($i-1), MSG_EOR) } $self->{2}->autoflush(1); # keep stdout buffered until x_it|DESTROY # $ENV_STR = join('', map { "\0$_=$ENV{$_}" } keys %ENV); -- 2.48.1