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 /upload-pack.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 'upload-pack.c')
-rw-r--r-- | upload-pack.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/upload-pack.c b/upload-pack.c index ebb4099268..dcd429dc01 100644 --- a/upload-pack.c +++ b/upload-pack.c @@ -1058,6 +1058,7 @@ static void receive_needs(struct upload_pack_data *data, const char *features; struct object_id oid_buf; const char *arg; + int feature_len; reset_timeout(data->timeout); if (packet_reader_read(reader) != PACKET_READ_NORMAL) @@ -1110,6 +1111,13 @@ static void receive_needs(struct upload_pack_data *data, parse_feature_request(features, "filter")) data->filter_capability_requested = 1; + arg = parse_feature_value(features, "session-id", &feature_len, NULL); + if (arg) { + char *client_sid = xstrndup(arg, feature_len); + trace2_data_string("transfer", NULL, "client-sid", client_sid); + free(client_sid); + } + o = parse_object(the_repository, &oid_buf); if (!o) { packet_writer_error(&data->writer, |