Commits


imsg_add() frees its msg argument on error; avoid double-free in error paths


apply time-based rate-limiting to got-fetch-pack download progress output


plug memory leaks in got-fetch-pack and got-send-pack ok naddy


let 'got fetch' send all references to the server to avoid redundant downloads Problem reported by naddy. ok naddy


fix some integers that had a slightly wrong type; patch by Omar Polo


de-duplicate a constant used by both 'got fetch' and 'got send' Both GOT_FETCH_PKTMAX and GOT_SEND_PKTMAX had the same value. Declare this value as GOT_PKT_MAX in got_lib_pkt.h instead.


move more code used by got-send-pack and got-fetch-pack to a common file Move functions and data structures which implement Git protocol features required for fetching and sending pack files to new files lib/gitproto.c and lib/got_lib_gitproto.h. This code was duplicated in got-fetch-pack and got-send-pack. No functional change.


move pkt code used by got-fetch-pack and got-send-pack to a common file The Git protocol uses a simple packet framing format. The got-fetch-pack and got-send-pack programs contained identical copies of functions to support this format. Move related functions to new file lib/pkt.c and link both programs against this common implementation. No functional change.


add a missing bounds-check in got-fetch-pack when parsing server response The tokenize_refline() function could end up reading past the end of the buffer if the refline is not terminated with whitespace or \0.


prevent NULL deref in got-fetch-pack if server does not announce capabilities The my_capabilities pointer may remain NULL. Check for NULL before use.


fix the error message shown when the server sends a bad ref line Exposed by trying to run got clone -l against shithub.us over git:// found by abieber@


style fix: avoid comparison of pointer variable against 0 in got-fetch-pack


work around spurious ACK responses from git servers in got-fetch-pack The Git server can apparently send duplicate ACK responses even though we do not enable the multi_ack capability. According to the Git protocol docs the server should only send ACKs after receiving 'done' from the client if multi_ack has been enabled. However, a duplicate ACK response can be triggered by running 'got fetch -a' in our fetch_update_tag test. This resulted in the following error: got-fetch-pack: unknown side-band received from server got: bad packet received


use size_t for loop indices to avoid signedness warnings; by emaste@freebsd Same change as 16aeacf7088d, for subdirectories other than lib/


indentation fixes


Stop including <sys/syslimits.h> directly. POSIX says the limits defined there are available from <limits.h>, which almost all affected source files already included anyway. ok millert stsp


zap trailing tabs


do not rely on <zlib.h> to pull in <unistd.h> ok stsp


Fix missing block grouping. ok tracey stsp


represent packfile hash as byte array in the privsep layer, not as object ID


compute pack file's checksum during download and check it in got-fetch-pack Compared to the previous version committed in 520a0c97 this code should compute the checksum correctly for any amount of pack file data bytes read from the socket at a time.


revert 520a0c97f8081e4531fc9c88cda705a92afbddaf for now due to possible bug


compute pack file's checksum during download and check it in got-fetch-pack


move functions from privsep.c to the helpers which use them where possible


add support for fetching arbitrary references to 'got clone' and 'got fetch'