mirror of
https://github.com/Twigpine/node.git
synced 2026-11-13 18:31:26 -10:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eaec6113e8 | ||
|
|
ceef11062e |
@@ -6440,6 +6440,13 @@ mod tests {
|
||||
/// Write one canned HTTP response on an accepted fake-S3 socket.
|
||||
/// A free function (not a closure) so the `&mut` socket borrow does
|
||||
/// not leak into a returned future's lifetime.
|
||||
///
|
||||
/// The fake serves one request per accepted socket and drops it, so each
|
||||
/// response says `Connection: close`. Without it the client keeps the
|
||||
/// socket in its pool after the server has closed it, and the next request
|
||||
/// can reuse a dead connection. The client has retries disabled, as in
|
||||
/// production, so `sweep_restores_tigris_cache_miss_and_skips_missing`
|
||||
/// failed with "repo acquire failed" on a loaded runner.
|
||||
async fn s3_respond(
|
||||
sock: &mut tokio::net::TcpStream,
|
||||
status: &str,
|
||||
@@ -6448,7 +6455,7 @@ mod tests {
|
||||
) {
|
||||
use tokio::io::AsyncWriteExt;
|
||||
let head = format!(
|
||||
"HTTP/1.1 {status}\r\nContent-Length: {}\r\n{extra}\r\n",
|
||||
"HTTP/1.1 {status}\r\nContent-Length: {}\r\nConnection: close\r\n{extra}\r\n",
|
||||
payload.len()
|
||||
);
|
||||
let _ = sock.write_all(head.as_bytes()).await;
|
||||
|
||||
Reference in new issue
Block a user