diff options
author | Eric Wong <e@80x24.org> | 2015-09-21 11:11:11 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-09-21 11:37:10 +0000 |
commit | 62f1d3057304ab1e598a3d3bff54fce1bca0dd72 (patch) | |
tree | fabe4b3623e8f0ba02b3713416882acfe71f0d88 /public-inbox-nntpd | |
parent | 326f7412b601e8d0d929026802e469bdb7fe1940 (diff) | |
download | public-inbox-62f1d3057304ab1e598a3d3bff54fce1bca0dd72.tar.gz |
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.
Diffstat (limited to 'public-inbox-nntpd')
-rw-r--r-- | public-inbox-nntpd | 4 |
1 files changed, 2 insertions, 2 deletions
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).']'; |