]> git.ipfire.org Git - thirdparty/git.git/commit
daemon: fix type of `max_connections`
authorPatrick Steinhardt <ps@pks.im>
Fri, 6 Dec 2024 10:27:26 +0000 (11:27 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Dec 2024 11:20:04 +0000 (20:20 +0900)
commit7d200af27f41b8732dcb1a6c01ff73b7b7b0ecc1
tree31807df4e6ea90a215f7226441072d862f2b7161
parent8108d1ac948c1029b29d8180dd5dbfdc5f2efb38
daemon: fix type of `max_connections`

The `max_connections` type tracks how many children git-daemon(1) would
spawn at the same time. This value can be controlled via a command line
switch: if given a positive value we'll set that up as the limit. But
when given either zero or a negative value we don't enforce any limit at
all.

But even when being passed a negative value we won't actually store it,
but normalize it to 0. Still, the variable used to store the config is
using a signed integer, which causes warnings when comparing the number
of accepted connections (`max_connections`) with the number of current
connections being handled (`live_children`).

Adapt the type of `max_connections` such that the types of both
variables match.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
daemon.c