upload-pack, serve: log received client session ID
When upload-pack (protocol v0/v1) or a protocol v2 server receives a session-id capability from a client, log the received session ID via a trace2 data event. Signed-off-by: Josh Steadmon <steadmon@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
1e905bbc00
commit
829594677c
4
serve.c
4
serve.c
@ -201,6 +201,7 @@ static int process_request(void)
|
||||
struct packet_reader reader;
|
||||
struct strvec keys = STRVEC_INIT;
|
||||
struct protocol_capability *command = NULL;
|
||||
const char *client_sid;
|
||||
|
||||
packet_reader_init(&reader, 0, NULL, 0,
|
||||
PACKET_READ_CHOMP_NEWLINE |
|
||||
@ -264,6 +265,9 @@ static int process_request(void)
|
||||
|
||||
check_algorithm(the_repository, &keys);
|
||||
|
||||
if (has_capability(&keys, "session-id", &client_sid))
|
||||
trace2_data_string("transfer", NULL, "client-sid", client_sid);
|
||||
|
||||
command->command(the_repository, &keys, &reader);
|
||||
|
||||
strvec_clear(&keys);
|
||||
|
Reference in New Issue
Block a user