From 829594677c3cd02f7d88b3cd3c72ad06f68faa14 Mon Sep 17 00:00:00 2001 From: Josh Steadmon Date: Wed, 11 Nov 2020 15:29:32 -0800 Subject: 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 Signed-off-by: Junio C Hamano --- serve.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'serve.c') diff --git a/serve.c b/serve.c index 8c0bb84f37..eec2fe6f29 100644 --- a/serve.c +++ b/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); -- cgit v1.2.3