Skip to content

Commit

Permalink
upload-pack: bump keepalive default to 5 seconds
Browse files Browse the repository at this point in the history
There is no reason not to turn on keepalives by default.
They take very little bandwidth, and significantly less than
the progress reporting they are replacing. And in the case
that progress reporting is on, we should never need to send
a keepalive anyway, as we will constantly be showing
progress and resetting the keepalive timer.

We do not necessarily know what the client's idea of a
reasonable timeout is, so let's keep this on the low side of
5 seconds. That is high enough that we will always prefer
our normal 1-second progress reports to sending a keepalive
packet, but low enough that no sane client should consider
the connection hung.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Sep 9, 2013
1 parent 05e9515 commit 115dedd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Documentation/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2173,7 +2173,7 @@ uploadpack.keepalive::
the server to be hung and give up. Setting this option instructs
`upload-pack` to send an empty keepalive packet every
`uploadpack.keepalive` seconds. Setting this option to 0
disables keepalive packets entirely. The default is 0.
disables keepalive packets entirely. The default is 5 seconds.

url.<base>.insteadOf::
Any URL that starts with this value will be rewritten to
Expand Down
2 changes: 1 addition & 1 deletion upload-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static struct object_array have_obj;
static struct object_array want_obj;
static struct object_array extra_edge_obj;
static unsigned int timeout;
static int keepalive = -1;
static int keepalive = 5;
/* 0 for no sideband,
* otherwise maximum packet size (up to 65520 bytes).
*/
Expand Down

0 comments on commit 115dedd

Please sign in to comment.