* [PATCH 1/4] lei: clobber recvmsg buffer on errors
2022-04-18 9:50 6% [PATCH 0/4] lei: finish wiring up pure-Perl stuff for Linux Eric Wong
@ 2022-04-18 9:50 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2022-04-18 9:50 UTC (permalink / raw)
To: meta
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/LEI.pm | 1 +
lib/PublicInbox/LeiSelfSocket.pm | 1 +
2 files changed, 2 insertions(+)
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, '+<&=', $_ };
}
^ permalink raw reply related [relevance 7%]
* [PATCH 0/4] lei: finish wiring up pure-Perl stuff for Linux
@ 2022-04-18 9:50 6% Eric Wong
2022-04-18 9:50 7% ` [PATCH 1/4] lei: clobber recvmsg buffer on errors Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2022-04-18 9:50 UTC (permalink / raw)
To: meta
Some cleanups here, too; but this hopefully makes lei more
accessible to users who don't have space/bandwidth to use
Inline::C.
I thought I sent these out weeks ago, but Real-Life, power outages
and other lei problems got in the way, I guess :x
Eric Wong (4):
lei: clobber recvmsg buffer on errors
syscall: more idiomatic cmsghdr space allocation
lei: wire up pure Perl sendmsg/recvmsg for Linux users
syscall: golf + more idiomatic buffer initialization
lib/PublicInbox/IPC.pm | 4 ++++
lib/PublicInbox/LEI.pm | 4 ++++
lib/PublicInbox/LeiSelfSocket.pm | 1 +
lib/PublicInbox/Syscall.pm | 13 ++++++-------
lib/PublicInbox/TestCommon.pm | 16 ++++++++++++----
t/lei-daemon.t | 6 +++++-
t/lei-externals.t | 1 +
7 files changed, 33 insertions(+), 12 deletions(-)
^ permalink raw reply [relevance 6%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-04-18 9:50 6% [PATCH 0/4] lei: finish wiring up pure-Perl stuff for Linux Eric Wong
2022-04-18 9:50 7% ` [PATCH 1/4] lei: clobber recvmsg buffer on errors Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
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).