diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-12-09 00:11:20 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-12-09 00:11:20 +0100 |
commit | 01b8886a62243c93cc57758bbaae08e11b09b9e1 (patch) | |
tree | 5fda28e41bc8ebc885e86bba7089a79080f8e865 /send-pack.c | |
parent | Merge branch 'mt/do-not-use-scld-in-working-tree' (diff) | |
parent | receive-pack: log received client session ID (diff) | |
download | git-01b8886a62243c93cc57758bbaae08e11b09b9e1.tar.xz git-01b8886a62243c93cc57758bbaae08e11b09b9e1.zip |
Merge branch 'js/trace2-session-id'
The transport layer was taught to optionally exchange the session
ID assigned by the trace2 subsystem during fetch/push transactions.
* js/trace2-session-id:
receive-pack: log received client session ID
send-pack: advertise session ID in capabilities
upload-pack, serve: log received client session ID
fetch-pack: advertise session ID in capabilities
transport: log received server session ID
serve: advertise session ID in v2 capabilities
receive-pack: advertise session ID in v0 capabilities
upload-pack: advertise session ID in v0 capabilities
trace2: add a public function for getting the SID
docs: new transfer.advertiseSID option
docs: new capability to advertise session IDs
Diffstat (limited to 'send-pack.c')
-rw-r--r-- | send-pack.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/send-pack.c b/send-pack.c index d2701bf35c..9045f8a082 100644 --- a/send-pack.c +++ b/send-pack.c @@ -425,6 +425,7 @@ int send_pack(struct send_pack_args *args, int use_sideband = 0; int quiet_supported = 0; int agent_supported = 0; + int advertise_sid = 0; int use_atomic = 0; int atomic_supported = 0; int use_push_options = 0; @@ -436,6 +437,8 @@ int send_pack(struct send_pack_args *args, const char *push_cert_nonce = NULL; struct packet_reader reader; + git_config_get_bool("transfer.advertisesid", &advertise_sid); + /* Does the other end support the reporting? */ if (server_supports("report-status-v2")) status_report = 2; @@ -451,6 +454,8 @@ int send_pack(struct send_pack_args *args, quiet_supported = 1; if (server_supports("agent")) agent_supported = 1; + if (!server_supports("session-id")) + advertise_sid = 0; if (server_supports("no-thin")) args->use_thin_pack = 0; if (server_supports("atomic")) @@ -507,6 +512,8 @@ int send_pack(struct send_pack_args *args, strbuf_addf(&cap_buf, " object-format=%s", the_hash_algo->name); if (agent_supported) strbuf_addf(&cap_buf, " agent=%s", git_user_agent_sanitized()); + if (advertise_sid) + strbuf_addf(&cap_buf, " session-id=%s", trace2_session_id()); /* * NEEDSWORK: why does delete-refs have to be so specific to |