History

[transport] remove Transport::close()…

…as it's really a misnomer for 'we are not going to make further requests and are not interested in a pack anymore'. It's used in V1 and V2 apparently to detect that we are done and allow the server to break out of a wait loop gracefully.

Sebastian Thiel committed 5 years ago

Commit 4268a9b1 parent cac1f6c10 files · +7 −61Browse files

Showing the changes to git-protocol/src/fetch/function.rs (1 of 10 files). Show all

Unified · Split

git-protocol/src/fetch/function.rs+5−1
@@ -145,7 +145,11 @@ where · 144 unmodified lines
145 fetch.validate_argument_prefixes_or_panic(protocol_version, &capabilities, &[], &fetch_features);145 fetch.validate_argument_prefixes_or_panic(protocol_version, &capabilities, &[], &fetch_features);
146 146
147 if next == Action::Cancel {147 if next == Action::Cancel {
148 transport.close().await?;148 // An empty request marks the (early) end of the interaction.
149 transport
150 .request(client::WriteMode::Binary, client::MessageKind::Flush)?
151 .into_read()
152 .await?;
149 return Ok(());153 return Ok(());
150 }154 }
151 155