git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
MLMartin Langhoff <martin@catalyst.net.nz>
Date
Dec 7, 2006, 03:38 UTC
Message-ID
<11654627303222-git-send-email-martin@catalyst.net.nz>

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(-)
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
Next: Junio C Hamano
Message 1 of 2 in “cvsserver: Avoid miscounting bytes in Perl v5.8.x”
  1. cvsserver: Avoid miscounting bytes in Perl v5.8.xMartin Langhoff, Dec 7, 2006
  2. Junio C HamanoDec 7, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.