dulwich team mailing list archive
-
dulwich team
-
Mailing list archive
-
Message #00015
Re: Patches: decode and verify packs as they stream
Hi Dave,
On Thu, 2010-04-15 at 10:27 -0700, David Borowitz wrote:
> I just pushed 6 new patches to my github repo:
> http://github.com/dborowitz/dulwich
>
>
> 4471b29 Prevent server stack trace when the client request is a no-op.
> c7a2465 Strip excess whitespace from capabilities lines.
> 04ad718 Add ReceivableProtocol that supports recv() as well as read().
> 3c97dff Fix read_zlib_chunks to avoid appending junk data.
> 65f2c56 Make the server decode a pack as it streams.
> be1dfac Clean up pack.py.
Thanks!
Some minor comments, all in protocol.py for some reason:
[...]
> self._recv = recv
> self._rbuf = StringIO()
> self._rbufsize = 8192
Can you please put this in a constant somewhere?
> # consumed.
> # Copyright (c) 2001-2010 Python Software Foundation; All Rights Reserved
Please mention the license (PSF?).
> # rbufsize is large compared to the typical return value of recv().
> buf = self._rbuf
> start = buf.tell()
> buf.seek(0, 2) # seek end
Please use os.SEEK_END rather than just 2, it's a bit clearer to read.
I wonder if PackStreamVerifier should have a base class that is shared
by PackData.iterobjects(), which seems to provide a lot of the same
functionality. But I'm happy to leave that refactoring for later.
Cheers,
Jelmer
Follow ups
References