Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 62 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions clash-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ aws-lc-rs = [
"russh/aws-lc-rs",
"boringtun/aws-lc-rs",
"hickory-net/https-aws-lc-rs",
"tuic-quinn?/rustls-aws-lc-rs",
"watfaq-dns/aws-lc-rs",
"rcgen/aws_lc_rs",
"shadowquic?/aws-lc-rs",
Expand All @@ -27,15 +26,14 @@ ring = [
"russh/ring",
"boringtun/ring",
"hickory-net/https-ring",
"tuic-quinn?/rustls-ring",
"watfaq-dns/ring",
"rcgen/ring",
"shadowquic?/ring",
]

# Protos
shadowsocks = ["dep:shadowsocks", "dep:blake3"]
tuic = ["dep:tuic-core", "dep:register-count", "dep:tuic-quinn"]
tuic = ["dep:tuic-core", "dep:register-count"]
ssh = ["dep:russh", "dep:dirs", "dep:totp-rs"]
onion = ["dep:arti-client", "dep:tor-rtcompat", "arti-client/onion-service-client"]
shadowquic = ["dep:shadowquic", "shadowquic?/shadowquic-quinn"]
Expand Down Expand Up @@ -184,10 +182,8 @@ tor-rtcompat = { version = "0.42", optional = true, default-features = false, fe


# tuic
tuic-core= { tag = "v1.8.1", optional = true, git = "https://github.com/Itsusinn/tuic.git", features = ["async_marshal", "marshal", "model"] }
tuic-core= { branch = "build/tuic", optional = true, git = "https://github.com/Itsusinn/tuic.git", features = ["async_marshal", "marshal", "model"] }
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick | 🔵 Trivial | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Remote build/tuic head:"
git ls-remote https://github.com/Itsusinn/tuic.git refs/heads/build/tuic

echo
echo "Pinned tuic-core entry in Cargo.lock (if present):"
if [ -f Cargo.lock ]; then
  rg -n -C3 'name = "tuic-core"|git\+https://github.com/Itsusinn/tuic\.git' Cargo.lock
else
  echo "Cargo.lock not found in this checkout."
fi

Repository: Watfaq/clash-rs

Length of output: 453


🏁 Script executed:

#!/bin/bash
# Check if Cargo.lock exists in repo and is tracked
if git ls-files Cargo.lock | grep -q Cargo.lock; then
  echo "Cargo.lock is tracked in git"
  git log --oneline -1 -- Cargo.lock 2>/dev/null | head -1 || echo "Cargo.lock exists"
else
  echo "Cargo.lock is NOT tracked in git"
fi

# Confirm the dependency source in Cargo.toml matches what we saw
rg -n 'tuic-core' clash-lib/Cargo.toml | head -5

Repository: Watfaq/clash-rs

Length of output: 348


Consider pinning tuic-core to an explicit rev for clarity.

The current branch = "build/tuic" reference is already locked via Cargo.lock to commit 562ea5706d28529e8db74128bb4a23edfe9c0ffa, ensuring deterministic builds. Switching to an explicit rev would make the pinned commit visible in Cargo.toml itself, improving code readability and reproducibility clarity.

Suggested change
-tuic-core= { branch = "build/tuic", optional = true, git = "https://github.com/Itsusinn/tuic.git", features = ["async_marshal", "marshal", "model"] }
+tuic-core = { rev = "562ea5706d28529e8db74128bb4a23edfe9c0ffa", optional = true, git = "https://github.com/Itsusinn/tuic.git", features = ["async_marshal", "marshal", "model"] }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
tuic-core= { branch = "build/tuic", optional = true, git = "https://github.com/Itsusinn/tuic.git", features = ["async_marshal", "marshal", "model"] }
tuic-core = { rev = "562ea5706d28529e8db74128bb4a23edfe9c0ffa", optional = true, git = "https://github.com/Itsusinn/tuic.git", features = ["async_marshal", "marshal", "model"] }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@clash-lib/Cargo.toml` at line 187, Replace the branch pin for the tuic-core
dependency in Cargo.toml with an explicit rev to make the commit visible in the
manifest: update the dependency entry for "tuic-core" (currently using branch =
"build/tuic") to use rev = "562ea5706d28529e8db74128bb4a23edfe9c0ffa" instead of
branch, keeping the same git URL, optional = true and features list so the exact
commit is documented in Cargo.toml.

register-count = { version = "0.1", optional = true }
# tuic-quinn gives tuic-specific quinn fork with rustls support (same fork as tuic-core uses internally)
tuic-quinn = { package = "quinn", branch = "bbrv3", git = "https://github.com/Tipuch/quinn.git", optional = true, default-features = false, features = ["runtime-tokio"] }

quinn = { version = "0.11", default-features = false, features = ["futures-io", "runtime-tokio"] }

Expand Down
2 changes: 1 addition & 1 deletion clash-lib/src/proxy/converters/tuic.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::time::Duration;

use tuic_quinn::VarInt;
use tuic_core::quinn::VarInt;

use crate::{
config::internal::proxy::OutboundTuic,
Expand Down
5 changes: 1 addition & 4 deletions clash-lib/src/proxy/tuic/handle_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ use anyhow::anyhow;
use bytes::Bytes;
use register_count::Register;
use std::sync::{Arc, atomic::Ordering};
use tuic_core::quinn::{
Task,
quinn::{RecvStream, SendStream, VarInt},
};
use tuic_core::quinn::{RecvStream, SendStream, Task, VarInt};

impl TuicConnection {
pub async fn accept_uni_stream(&self) -> anyhow::Result<(RecvStream, Register)> {
Expand Down
2 changes: 1 addition & 1 deletion clash-lib/src/proxy/tuic/handle_task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use bytes::Bytes;
use std::{sync::Arc, time::Duration};
use tuic_core::{
Address,
quinn::{Connect, Packet, quinn::ZeroRttAccepted},
quinn::{Connect, Packet, ZeroRttAccepted},
};

use super::types::{TuicConnection, UdpRelayMode};
Expand Down
2 changes: 1 addition & 1 deletion clash-lib/src/proxy/tuic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use anyhow::Result;
use async_trait::async_trait;

use tracing::debug;
use tuic_quinn::{
use tuic_core::quinn::{
ClientConfig as QuinnConfig, Endpoint as QuinnEndpoint, EndpointConfig,
TokioRuntime, TransportConfig as QuinnTransportConfig, VarInt,
congestion::{Bbr3Config, CubicConfig, NewRenoConfig},
Expand Down
6 changes: 2 additions & 4 deletions clash-lib/src/proxy/tuic/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@ use std::{
use tokio::sync::RwLock as AsyncRwLock;
use tracing::debug;
use tuic_core::quinn::{
Connection as InnerConnection,
quinn::{
Connection as QuinnConnection, Endpoint as QuinnEndpoint, ZeroRttAccepted,
},
Connection as InnerConnection, Endpoint as QuinnEndpoint, QuinnConnection,
ZeroRttAccepted,
};
use uuid::Uuid;

Expand Down
Loading