threads / patch / 43748

patchcvsserver: Avoid miscounting bytes in Perl v5.8.x

Subject: [PATCH] cvsserver: Avoid miscounting bytes in Perl v5.8.x

## tl;dr

2 messages between Dec 7, 2006 and Dec 7, 2006. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Martin Langhoff· Dec 7, 2006, 03:38 UTC · lore

At some point between v5.6 and 5.8 Perl started to assume its input, output and filehandles are UTF-8. This breaks the counting of bytes for the CVS protocol, resulting in the client expecting less data than we actually send, and storing truncated files.

Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
---

This has gone unfixed for quite a while. I thought I had seen a patch posted addressing it, but it may have been for something else.

In fact, our heavily patched gitweb.cgi has needed a similar patch as well. Snapshot downloads were getting corrupted until we added use bytes; there too. I'm not sure how current gitweb does it though...

---
 git-cvsserver.perl |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
Show changes to git-cvsserver.perl +1 −0
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index ca519b7..197014d 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -17,6 +17,7 @@
 
 use strict;
 use warnings;
+use bytes;
 
 use Fcntl;
 use File::Temp qw/tempdir tempfile/;
-- 
1.4.4.1.g7923a
Junio C Hamano· Dec 7, 2006, 05:48 UTC · re: Martin Langhoff · lore

Re: [PATCH] cvsserver: Avoid miscounting bytes in Perl v5.8.x

Martin Langhoff <martin@catalyst.net.nz> writes:
> At some point between v5.6 and 5.8 Perl started to assume its input,
> output and filehandles are UTF-8. This breaks the counting of bytes
> for the CVS protocol, resulting in the client expecting less data
> than we actually send, and storing truncated files.
Thanks.  Will queue for both maint and master.

← back to recent threads