From 62f1d3057304ab1e598a3d3bff54fce1bca0dd72 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 21 Sep 2015 11:11:11 +0000 Subject: remove bytes:: for length checks Apparently, my mental model of Perl internals is still incorrect after all these years. I am but a simple *nix programmer: everything is a bag of bytes to me. This fixes a problem with UTF-8 headers from Xapian (via "XHDR Subject [range]") triggering partial writes and writing an extra newline to the outputs. --- public-inbox-nntpd | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'public-inbox-nntpd') diff --git a/public-inbox-nntpd b/public-inbox-nntpd index 0395e98b..674ecad7 100644 --- a/public-inbox-nntpd +++ b/public-inbox-nntpd @@ -172,13 +172,13 @@ sub sockname { my ($s) = @_; my $n = getsockname($s) or return; my ($port, $addr); - if (bytes::length($n) >= 28) { + if (length($n) >= 28) { require Socket6; ($port, $addr) = Socket6::unpack_sockaddr_in6($n); } else { ($port, $addr) = Socket::sockaddr_in($n); } - if (bytes::length($addr) == 4) { + if (length($addr) == 4) { $n = Socket::inet_ntoa($addr) } else { $n = '['.Socket6::inet_ntop(Socket6::AF_INET6(), $addr).']'; -- cgit v1.2.3-24-ge0c7