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

Re: zlib experts, please..

From
Linus Torvalds <torvalds@osdl.org>
Date
Jul 6, 2005, 00:04 UTC
Message-ID
<Pine.LNX.4.58.0507051701101.3570@g5.osdl.org>
In-Reply-To
<Pine.LNX.4.58.0507051644100.3570@g5.osdl.org>
On Tue, 5 Jul 2005, Linus Torvalds wrote:
Show 5 quoted lines
> 
> But what I care about is that when git-unpack-objects sees that it wants a 
> zero-byte object, and asks zlib to unpack it, zlib will not actually use 
> the bytes it wrote - it will just say "oh, you wanted zero bytes, here's 
> zero bytes". Which means that the stream handling gets upset.

Actually, never mind. zlib does exactly the right thing, and eats the 8 bytes of header that it wrote for "empty". The real culprit was that git-unpack-objects incorrectly made that zero a special case on reading, but not writing.

So just ignore me. zlib actually does what I expected it to do, even for the zero case.

		Linus
Previous: Linus Torvalds
Message 2 of 2 in “zlib experts, please..”
  1. Linus TorvaldsJul 5, 2005
  2. Linus TorvaldsJul 6, 2005

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.