about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2022-04-18 09:50:01 +0000
committerEric Wong <e@80x24.org>2022-04-18 21:53:45 +0000
commit6b52fe53a1f9e69a6ecfce16216a1fa180e4645f (patch)
tree8e2ed0b594ab49a4fbac0617989f19323cbdf3bc /lib/PublicInbox
parent9f4279438bec8d0b52c8afc513142cc9d21ad8b8 (diff)
downloadpublic-inbox-6b52fe53a1f9e69a6ecfce16216a1fa180e4645f.tar.gz
It will be necessary when we drop the Inline::C requirement
since the pure Perl Linux syscall recvmsg implementation.

This likely would've caused errors for Socket::MsgHdr users
without Inline::C, but I haven't tested it since it's a rare
configuration.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/LEI.pm1
-rw-r--r--lib/PublicInbox/LeiSelfSocket.pm1
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index a7ddc21f..9ab91714 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -1149,6 +1149,7 @@ sub event_step {
                 if (scalar(@fds) == 1 && !defined($fds[0])) {
                         return if $! == EAGAIN;
                         die "recvmsg: $!" if $! != ECONNRESET;
+                        $buf = '';
                         @fds = (); # for open loop below:
                 }
                 for (@fds) { open my $rfh, '+<&=', $_ }
diff --git a/lib/PublicInbox/LeiSelfSocket.pm b/lib/PublicInbox/LeiSelfSocket.pm
index dd64b6cf..860020cb 100644
--- a/lib/PublicInbox/LeiSelfSocket.pm
+++ b/lib/PublicInbox/LeiSelfSocket.pm
@@ -29,6 +29,7 @@ sub event_step {
         if (scalar(@fds) == 1 && !defined($fds[0])) {
                 return if $!{EAGAIN};
                 die "recvmsg: $!" unless $!{ECONNRESET};
+                $buf = '';
         } else { # just in case open so perl can auto-close them:
                 for (@fds) { open my $fh, '+<&=', $_ };
         }