-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: 使用 AFIT 特性取代 async-trait 框架 core: 重新使用更小的 async-h1 请求后端并修正请求失败的问题 core: 更换 User-Agent core: 增加离线用户 UUID 生成函数接口 scl-gui-widget: 为 DownloadModuleItem 增加可选图片图标 scl-macro: 修正文档
- Loading branch information
Showing
16 changed files
with
147 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,14 +8,15 @@ license = "LGPL-3.0-only" | |
readme = "README.md" | ||
authors = ["Steve-xmh <[email protected]>"] | ||
edition = "2021" | ||
rust-version = "1.75" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
anyhow = "^1.0" | ||
base64 = "^0.21" | ||
futures = "^0.3.21" | ||
surf = { version = "^2.3", default-features = false, features = [ "curl-client", "encoding" ] } | ||
surf = { version = "^2.3", default-features = false, features = [ "h1-client", "encoding" ] } | ||
image = { version = "^0.24", default-features = false, features = ["jpeg", "png", "gif", "bmp", "rgb"] } | ||
webp = "^0.2" | ||
nom = "^7.1" | ||
|
@@ -25,23 +26,23 @@ serde = { version = "^1.0", features = ["derive"] } | |
serde_json = "^1.0" | ||
sha1_smol = { version = "^1.0", features = ["std"] } | ||
shell-words = "^1.0" | ||
smol = "^1.2" | ||
toml = "^0.7" | ||
smol = "^2" | ||
toml = "^0.8" | ||
url = "^2.2" | ||
urlencoding = "^2.1" | ||
uuid = { version = "1.0.0", features = ["v4"] } | ||
concat-string = "^1.0" | ||
md5 = "^0.7" | ||
zip = "^0.6.2" | ||
dirs = "^5.0" | ||
async-trait = "^0.1" | ||
shellwords = "1.1.0" | ||
fs_extra = "1.3.0" | ||
tracing = "0.1.40" | ||
tracing = "^0.1" | ||
|
||
[target.'cfg(target_os = "windows")'.dependencies] | ||
winreg = "^0.50" | ||
winreg = "^0.52" | ||
|
||
[target.'cfg(target_os = "windows")'.dependencies.windows] | ||
version = "0.48" | ||
version = "0.52" | ||
features = [ | ||
"Win32_System_Diagnostics_Debug", | ||
"Win32_Foundation", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,13 +58,16 @@ fn logger( | |
} | ||
|
||
static GLOBAL_CLIENT: Lazy<Arc<Client>> = Lazy::new(|| { | ||
let scl_version = std::option_env!("SCL_VERSION_TYPE").unwrap_or("0.0.0"); | ||
let client = Config::new() | ||
.add_header( | ||
"User-Agent", | ||
"github.com/Steve-xmh/SharpCraftLauncher ([email protected])", | ||
format!("SharpCraftLauncher/{scl_version} (github.com/Steve-xmh/SharpCraftLauncher) ([email protected])"), | ||
) | ||
.unwrap() | ||
.set_timeout(Some(Duration::from_secs(30))); | ||
.set_timeout(Some(Duration::from_secs(30))) | ||
.set_http_keep_alive(false) // async-h1 似乎不兼容使用 Keep Alive,会导致解析响应出错 | ||
.set_max_connections_per_host(1024); | ||
let client = if let Ok(mut proxy) = std::env::var("HTTP_PROXY") { | ||
let proxy = if proxy.ends_with('/') { | ||
proxy | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ | |
*/ | ||
|
||
#![forbid(missing_docs)] | ||
#![allow(async_fn_in_trait)] | ||
|
||
pub mod auth; | ||
pub mod client; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.