diff options
author | Josh Steadmon <steadmon@google.com> | 2020-11-11 15:29:32 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-11 18:26:53 -0800 |
commit | 829594677c3cd02f7d88b3cd3c72ad06f68faa14 (patch) | |
tree | e3ef49e00362cf7da17faf7711760ad55d8e3c70 /serve.c | |
parent | 1e905bbc008dfc3c0ffe14b55bd920e188e51b4e (diff) | |
download | git-829594677c3cd02f7d88b3cd3c72ad06f68faa14.tar.gz |
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>
Diffstat (limited to 'serve.c')
-rw-r--r-- | serve.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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); |