diff options
author | Eric Wong <e@80x24.org> | 2019-06-24 02:52:32 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-06-24 05:26:26 +0000 |
commit | c100879166cbbd6c2481ce68a549dab7d018d826 (patch) | |
tree | e3f0e8277df710c77f6ec4a82a328d61d4cc0f48 /lib/PublicInbox/NNTP.pm | |
parent | a3cb58141cb7ef78fc4b3b85f6132804972c20e7 (diff) | |
download | public-inbox-c100879166cbbd6c2481ce68a549dab7d018d826.tar.gz |
It should not matter because our rbuf is always from a socket without encoding layers, but this makes things easier to follow.
Diffstat (limited to 'lib/PublicInbox/NNTP.pm')
-rw-r--r-- | lib/PublicInbox/NNTP.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index 6a582ea4..a9e54a68 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -243,7 +243,7 @@ sub parse_time ($$;$) { } my @now = $gmt ? gmtime : localtime; my ($YYYY, $MM, $DD); - if (length($date) == 8) { # RFC 3977 allows YYYYMMDD + if (bytes::length($date) == 8) { # RFC 3977 allows YYYYMMDD ($YYYY, $MM, $DD) = unpack('A4A2A2', $date); } else { # legacy clients send YYMMDD ($YYYY, $MM, $DD) = unpack('A2A2A2', $date); @@ -944,7 +944,7 @@ sub event_step { my $r; if (index($$rbuf, "\n") < 0) { - my $off = length($$rbuf); + my $off = bytes::length($$rbuf); $r = sysread($self->{sock}, $$rbuf, LINE_MAX, $off); unless (defined $r) { return $! == EAGAIN ? $self->watch_in1 : $self->close; @@ -964,7 +964,7 @@ sub event_step { } return $self->close if $r < 0; - my $len = length($$rbuf); + my $len = bytes::length($$rbuf); return $self->close if ($len >= LINE_MAX); update_idle_time($self); |