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
@ -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,
|
||||
|
||||
Reference in New Issue
Block a user