From 6b52fe53a1f9e69a6ecfce16216a1fa180e4645f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 18 Apr 2022 09:50:01 +0000 Subject: lei: clobber recvmsg buffer on errors 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. --- lib/PublicInbox/LeiSelfSocket.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/PublicInbox/LeiSelfSocket.pm') 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, '+<&=', $_ }; } -- cgit v1.2.3-24-ge0c7