Skip to content

Commit 115dedd

Browse files
peffgitster
authored andcommitted
upload-pack: bump keepalive default to 5 seconds
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 05e9515 commit 115dedd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Documentation/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2173,7 +2173,7 @@ uploadpack.keepalive::
21732173
the server to be hung and give up. Setting this option instructs
21742174
`upload-pack` to send an empty keepalive packet every
21752175
`uploadpack.keepalive` seconds. Setting this option to 0
2176-
disables keepalive packets entirely. The default is 0.
2176+
disables keepalive packets entirely. The default is 5 seconds.
21772177

21782178
url.<base>.insteadOf::
21792179
Any URL that starts with this value will be rewritten to

upload-pack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static struct object_array have_obj;
4040
static struct object_array want_obj;
4141
static struct object_array extra_edge_obj;
4242
static unsigned int timeout;
43-
static int keepalive = -1;
43+
static int keepalive = 5;
4444
/* 0 for no sideband,
4545
* otherwise maximum packet size (up to 65520 bytes).
4646
*/

0 commit comments

Comments
 (0)