-
Notifications
You must be signed in to change notification settings - Fork 276
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
88 changed files
with
3,701 additions
and
1,142 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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
## [1.1.1.82] - 2023-04-15 | ||
### Improvements: | ||
Optimize bdt uptime logic when no udp endpoint is available | ||
Protocol stack optimization guessing mime logic | ||
Protocol stack optimization and DecApp related caching logic | ||
Issue #156: AppManager optimizes the uninstall logic of DecApp | ||
Issue #165, #168: Optimization of AppManager's local repo logic | ||
Issue #170: Optimization of AppManager's state repair logic at startup | ||
Issue #196: The -overwrite parameter of ood-installer can control whether to overwrite the original system-config.toml file | ||
Issue #201: Optimize the hash detection logic of the protocol stack chunk reader | ||
|
||
### Fixes: | ||
Issue #157: AppManager may not stop the timeout DecApp installation command correctly under Windows | ||
Fix the service execution problem of AppManager in docker mode. | ||
Fixed a status problem when AppManager reports decapp to ood-daemon. | ||
Fixed some problems related to NDN chunk. | ||
Bdt fixed multiple panic | ||
Issue #183, #186, #187: Fixed multiple panics in the protocol stack | ||
Issue #185: Use cyfs-async-h1 to replace the original async-h1 to avoid panic caused by invalid http header | ||
Issue #198: AppManager does not handle the timeout of install command correctly in docker mode. | ||
Fix: AppManager incorrectly set the App status when it received the Install command, resulting in the inability to retry the installation logic after reboot |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,122 @@ | ||
use cyfs_base::*; | ||
|
||
use http_types::Url; | ||
use serde::{Deserialize, Serialize}; | ||
|
||
#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] | ||
pub struct RemoteArchiveUrl { | ||
pub base_url: String, | ||
pub file_name: Option<String>, | ||
pub query_string: Option<String>, | ||
} | ||
|
||
impl RemoteArchiveUrl { | ||
pub fn parse_url(&self) -> BuckyResult<Url> { | ||
let url = match &self.file_name { | ||
Some(file_name) => { | ||
format!("{}/{}", self.base_url.trim_end_matches('/'), file_name) | ||
} | ||
None => self.base_url.clone(), | ||
}; | ||
|
||
let mut url = Url::parse(&url).map_err(|e| { | ||
let msg = format!( | ||
"invalid remote archive url format! {}, {}", | ||
self.base_url, e | ||
); | ||
error!("{}", msg); | ||
BuckyError::new(BuckyErrorCode::InvalidFormat, msg) | ||
})?; | ||
|
||
if let Some(query) = &self.query_string { | ||
url.set_query(Some(query.as_str())); | ||
} | ||
|
||
Ok(url) | ||
} | ||
} | ||
|
||
#[derive(Clone, Debug, Serialize, Deserialize)] | ||
pub enum RemoteArchiveInfo { | ||
ZipFile(RemoteArchiveUrl), | ||
Folder(RemoteArchiveUrl), | ||
} | ||
|
||
impl RemoteArchiveInfo { | ||
// Supports URLs in two formats | ||
// {base_url}?{query_string} | ||
// {base_url}/${filename}?{query_string} | ||
pub fn parse(url: &str) -> BuckyResult<Self> { | ||
let (base_url, query_string) = match url.split_once("?") { | ||
Some((base_url, query_string)) => (base_url.to_owned(), Some(query_string.to_owned())), | ||
None => (url.to_owned(), None), | ||
}; | ||
|
||
let ret = match base_url.find("${filename}") { | ||
Some(_) => { | ||
let base_url = base_url.replace("${filename}", ""); | ||
|
||
let info = RemoteArchiveUrl { | ||
base_url, | ||
file_name: None, | ||
query_string, | ||
}; | ||
RemoteArchiveInfo::Folder(info) | ||
} | ||
None => { | ||
let info = RemoteArchiveUrl { | ||
base_url, | ||
file_name: None, | ||
query_string, | ||
}; | ||
RemoteArchiveInfo::ZipFile(info) | ||
} | ||
}; | ||
|
||
Ok(ret) | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod test { | ||
use super::RemoteArchiveInfo; | ||
|
||
#[test] | ||
fn test_url() { | ||
let url = "http://127.0.0.1:1234/a/b?token=123456"; | ||
let info = RemoteArchiveInfo::parse(url).unwrap(); | ||
if let RemoteArchiveInfo::ZipFile(info) = info { | ||
assert_eq!(info.base_url, "http://127.0.0.1:1234/a/b"); | ||
assert_eq!(info.query_string.as_deref(), Some("token=123456")); | ||
} else { | ||
unreachable!(); | ||
} | ||
|
||
let url = "http://127.0.0.1:1234/a/b"; | ||
let info = RemoteArchiveInfo::parse(url).unwrap(); | ||
if let RemoteArchiveInfo::ZipFile(info) = info { | ||
assert_eq!(info.base_url, "http://127.0.0.1:1234/a/b"); | ||
assert_eq!(info.query_string, None); | ||
} else { | ||
unreachable!(); | ||
} | ||
|
||
let url = "http://127.0.0.1:1234/a/b/${filename}?token=123456"; | ||
let info = RemoteArchiveInfo::parse(url).unwrap(); | ||
if let RemoteArchiveInfo::Folder(info) = info { | ||
assert_eq!(info.base_url, "http://127.0.0.1:1234/a/b/"); | ||
assert_eq!(info.query_string.as_deref(), Some("token=123456")); | ||
} else { | ||
unreachable!(); | ||
} | ||
|
||
let url = "http://127.0.0.1:1234/a/b/${filename}"; | ||
let info = RemoteArchiveInfo::parse(url).unwrap(); | ||
if let RemoteArchiveInfo::Folder(info) = info { | ||
assert_eq!(info.base_url, "http://127.0.0.1:1234/a/b/"); | ||
assert_eq!(info.query_string, None); | ||
} else { | ||
unreachable!(); | ||
} | ||
} | ||
} |
Oops, something went wrong.