Skip to content

Commit 4ab1e0b

Browse files
cclaude
andcommitted
Fix directory download deadlock, 2.3x download speedup
Root cause: client semaphore blocked stream reading, filling the QUIC connection receive window (10MB) with unread data. This blocked ALL server writes including to streams the client was actively reading. Fix: remove client-side semaphore (server already controls concurrency), acquire server permits before spawning tasks. Update squic-rust with MAC2/cookie DDoS protection and BBR congestion controller support. Downloads improved from ~85 MB/s to 192 MB/s on 1GB files. 100x1MB directory downloads no longer hang. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c84d492 commit 4ab1e0b

15 files changed

Lines changed: 33 additions & 34 deletions

File tree

Cargo.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/sqscp/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqscp"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55

66
[[bin]]

crates/sqscp/src/main.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,8 @@ async fn download(
561561
let progress = Arc::new(Progress::new(total_files, cli.quiet));
562562
progress.set_total_bytes(total_bytes);
563563

564-
// Accept streams as they arrive from server, process up to j concurrently
565-
let sem = Arc::new(Semaphore::new(cli.jobs));
564+
// Accept streams as they arrive from server, read immediately
565+
// (no client semaphore — server controls concurrency)
566566
let mut handles = Vec::new();
567567
let mut received = 0;
568568

@@ -583,14 +583,11 @@ async fn download(
583583
let local_path = dest.join(&header.path);
584584
let file_path = header.path.clone();
585585

586-
let sem = sem.clone();
587586
let progress = progress.clone();
588587
let preserve = cli.preserve;
589588
let bw_limit = cli.limit;
590589

591590
let handle = tokio::spawn(async move {
592-
let _permit = sem.acquire().await.unwrap();
593-
594591
if let Some(parent) = local_path.parent() {
595592
std::fs::create_dir_all(parent).ok();
596593
}

crates/sqsftp/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqsftp"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55

66
[[bin]]

crates/sqssh-add/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqssh-add"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55

66
[[bin]]

crates/sqssh-agent/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqssh-agent"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55

66
[[bin]]

crates/sqssh-copy-id/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqssh-copy-id"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55

66
[[bin]]

crates/sqssh-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqssh-core"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55

66
[dependencies]

crates/sqssh-keygen/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqssh-keygen"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55

66
[[bin]]

crates/sqssh-keyscan/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "sqssh-keyscan"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55

66
[[bin]]

0 commit comments

Comments
 (0)