diff options
author | Josh Steadmon <steadmon@google.com> | 2020-11-11 15:29:34 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-11-11 18:26:53 -0800 |
commit | a2a066d96aeaa13fe9124b84978d333243aa17c9 (patch) | |
tree | 1cbe76f7c20bf3d87fc4ea95ab9b003c5b77744c /builtin | |
parent | send-pack: advertise session ID in capabilities (diff) | |
download | tgif-a2a066d96aeaa13fe9124b84978d333243aa17c9.tar.xz |
receive-pack: log received client session ID
When receive-pack receives a session-id capability from the 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 'builtin')
-rw-r--r-- | builtin/receive-pack.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 6ed498b6c7..deb5f859a9 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -2039,6 +2039,7 @@ static struct command *read_head_info(struct packet_reader *reader, if (linelen < reader->pktlen) { const char *feature_list = reader->line + linelen + 1; const char *hash = NULL; + const char *client_sid; int len = 0; if (parse_feature_request(feature_list, "report-status")) report_status = 1; @@ -2061,6 +2062,12 @@ static struct command *read_head_info(struct packet_reader *reader, } if (xstrncmpz(the_hash_algo->name, hash, len)) die("error: unsupported object format '%s'", hash); + client_sid = parse_feature_value(feature_list, "session-id", &len, NULL); + if (client_sid) { + char *sid = xstrndup(client_sid, len); + trace2_data_string("transfer", NULL, "client-sid", client_sid); + free(sid); + } } if (!strcmp(reader->line, "push-cert")) { |