Commit Briefs

bc5e881ab9 Stefan Sperling

plug a memory leak in got_fetch_pack(); patch by Mikhail


8934ea8b1b Omar Polo

factorize imsg_clear calls after imsg_flush failures

imsg_clear frees and closes resources allocated as part of enqueueing imsgs so it's a no-op after reads. discussed with and ok stsp@


688fe08b75 Omar Polo

fix fd leak in got_fetch_pack, ok stsp@


197088a4e2 Stefan Sperling

whitespace



dd088d9503 Stefan Sperling

let 'got fetch' send all references to the server to avoid redundant downloads

Problem reported by naddy. ok naddy


965803d33f Stefan Sperling

fix 'got fetch' downloading too many objects in some cases

Always announce all local references to the server when fetching changes. We used to do this only in mirror mode. In regular mode only refs/tags and refs/remotes/origin were announced, which could result in unnecessary downloads if relevant objects exist in refs/heads or elsewhere.


5e5da8c4bc Stefan Sperling

rename got_fetch_parse_uri() to got_dial_parse_uri()

This function is now being used by both 'got fetch' and 'got send' so its former name was misleading.


77d7d3bb1a Stefan Sperling

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.


d65a88a2f0 Stefan Sperling

move duplicated dial_ssh() and dial_git() functions into a common file

These functions are used by 'got send' and 'got fetch' in order to open network connections to a server. Move them into new file lib/dial.c and declare relevant functions in got_dial.h and lib/got_lib_dial.h. No functional change.


9ec58fff16 Stefan Sperling

use socketpair(2) instead of pipe(2) for bi-directional communication

On Linux, pipes returned from pipe(2) only work in one direction. This broke 'got clone' over ssh in the -portable version because got-fetch-pack assumes it can use its fetchfd for both reading and writing. I wrote a complicated diff to use two pipe(2) calls instead of one, but millert suggested a simpler solution: Use socketpair(2) instead of pipe(2). ok millert jrick tracey


f270548637 Christian Weisgerber

dial_git(): fix memory leak and simplify

Simplify dial_git() by formatting the initial Git protocol packet with dprintf, suggested by millert, and stop leaking an asprintf buffer. ok stsp


4d9042b347 Stefan Sperling

fix error checking in dial_ssh()


08578a35f6 Stefan Sperling

make close(2) failure checks consistent; check 'close() == -1' everywhere

ok millert, naddy


d9dff0e5c6 Stefan Sperling

switch reflist to TAILQ; insert elements more efficiently for sorted input

ok naddy


ccf6dd5ee6 Stefan Sperling

avoid signed vs unsigned comparisons in fetch.c

ssizeof() macro idea courtesy of millert@ ok millert@



0843a4ce46 Sebastien marie

use fchmod(2) instead of chmod(2). it is less racy, and we just opened the descriptor.

ok naddy@ stsp@






23c57b285f Christian Weisgerber

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


78fb09675b Christian Weisgerber

use the POSIX standard endian functions and explicitly include <endian.h>

ok stsp


81a12da586 Christian Weisgerber

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

ok stsp