hgweb Odd-string length error

Matt Mackall mpm at selenic.com
Tue Jul 22 17:12:43 UTC 2014


On Tue, 2014-07-22 at 10:30 -0400, Jérôme Godbout wrote:
> Just a question, since the hash is of known length, should the encoding and
> decoding be using struct.pack/unpack with a specific length to get the
> proper information and avoid this problem with the unhexlify() hex()
> function directly on a variable lenght string?

Yep, but a) you are the only person to see this in 9 years and b) it
indicates very serious problems in your stack that will break everything
else too. So no point fixing it. In fact, it's moved the problem to
somewhere we can diagnose it early and "easily". Just imagine how hard
it would be to spot the problem when the error message is "damaged zlib
data".

> Can somebody point out the part of the mercurial module where I could hook
> to see the answer before it return from the CGI request (I want to make
> sure which part, Apache or the python scripting is inserting the bad
> endline, so maybe I can work on the right part at least). Not sure I can
> modify this into Apache or for cgi module, I will look into it.

Apache's fine. If it wasn't, we'd be getting hundreds of complaints.
Look for something peculiar to your environment.

http://www.selenic.com/hg/file/a5168eb9b2bc/mercurial/hgweb/protocol.py#l77
http://www.selenic.com/hg/file/a5168eb9b2bc/mercurial/wireproto.py

-- 
Mathematics is the supreme nostalgia of our time.





More information about the Mercurial mailing list