diff options
author | Eric Wong <e@yhbt.net> | 2020-01-25 20:57:57 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-01-27 02:58:03 +0000 |
commit | fcfa0d639da338c470f07942da71f78fa65354a1 (patch) | |
tree | 24065141751adacf4898fd1546fd90dd9f7bbd91 /lib/PublicInbox/DS.pm | |
parent | 05a06f3262a2ddbf46adb85169e13ce9127e4524 (diff) | |
download | public-inbox-fcfa0d639da338c470f07942da71f78fa65354a1.tar.gz |
The "perlio" layer doesn't do read(2) syscalls over 8192 bytes at the moment, and binmode($fh, ':unix') leaks[1]. So use sysseek and sysread for now, since I can't see retaining compatibility with PerlIO::scalar being worth the trouble. [1] http://nntp.perl.org/group/perl.perl5.porters/256918
Diffstat (limited to 'lib/PublicInbox/DS.pm')
-rw-r--r-- | lib/PublicInbox/DS.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index c76a5038..4d685131 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -395,10 +395,10 @@ sub close { sub send_tmpio ($$) { my ($sock, $tmpio) = @_; - seek($tmpio->[0], $tmpio->[1], SEEK_SET) or return; + sysseek($tmpio->[0], $tmpio->[1], SEEK_SET) or return; my $n = $tmpio->[2] // 65536; $n = 65536 if $n > 65536; - defined(my $to_write = read($tmpio->[0], my $buf, $n)) or return; + defined(my $to_write = sysread($tmpio->[0], my $buf, $n)) or return; my $written = 0; while ($to_write > 0) { if (defined(my $w = syswrite($sock, $buf, $to_write, $written))) { |