mirror of
https://github.com/rustfs/rustfs.git
synced 2026-01-17 01:30:33 +00:00
fix build target windows check errors
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
use super::IOStats;
|
||||
use crate::{disk::Info, error::Result};
|
||||
use std::io::{Error, ErrorKind, Result as IoResult};
|
||||
use std::io::{Error, ErrorKind};
|
||||
use std::mem;
|
||||
use std::os::windows::ffi::OsStrExt;
|
||||
use std::path::Path;
|
||||
@@ -135,10 +135,10 @@ fn get_fs_type(p: &[WCHAR]) -> Result<String> {
|
||||
Ok(utf16_to_string(&lp_file_system_name_buffer))
|
||||
}
|
||||
|
||||
pub fn same_disk(disk1: &str, disk2: &str) -> Result<bool> {
|
||||
pub fn same_disk(_add_extensiondisk1: &str, _disk2: &str) -> Result<bool> {
|
||||
Ok(false)
|
||||
}
|
||||
|
||||
pub fn get_drive_stats(major: u32, minor: u32) -> Result<IOStats> {
|
||||
pub fn get_drive_stats(_major: u32, _minor: u32) -> Result<IOStats> {
|
||||
Ok(IOStats::default())
|
||||
}
|
||||
|
||||
@@ -105,7 +105,7 @@ pub async fn check_key_valid(security_token: Option<String>, ak: &str) -> S3Resu
|
||||
let (u, ok) = iam_store
|
||||
.check_key(ak)
|
||||
.await
|
||||
.map_err(|e| S3Error::with_message(S3ErrorCode::InternalError, format!("check claims failed {}", e)))?;
|
||||
.map_err(|e| S3Error::with_message(S3ErrorCode::InternalError, format!("check claims failed1 {}", e)))?;
|
||||
|
||||
if !ok {
|
||||
if let Some(u) = u {
|
||||
@@ -159,7 +159,7 @@ pub fn check_claims_from_token(token: &str, cred: &auth::Credentials) -> S3Resul
|
||||
}
|
||||
|
||||
if cred.is_temp() || cred.is_expired() {
|
||||
return Err(s3_error!(InvalidRequest, "invalid access key"));
|
||||
return Err(s3_error!(InvalidRequest, "invalid access key is temp or expired"));
|
||||
}
|
||||
|
||||
let Some(sys_cred) = get_global_action_cred() else {
|
||||
|
||||
@@ -54,6 +54,9 @@ pub struct Opt {
|
||||
#[arg(long)]
|
||||
pub domain_name: Option<String>,
|
||||
|
||||
#[arg(long, default_value_t = false)]
|
||||
pub console_enable: bool,
|
||||
|
||||
#[arg(long, default_value_t = format!("0.0.0.0:{}", 0))]
|
||||
pub console_address: String,
|
||||
}
|
||||
|
||||
@@ -240,9 +240,12 @@ async fn run(opt: config::Opt) -> Result<()> {
|
||||
|
||||
info!("server was started");
|
||||
|
||||
tokio::spawn(async move {
|
||||
console::start_static_file_server(&opt.console_address).await;
|
||||
});
|
||||
if opt.console_enable {
|
||||
info!("console is enabled");
|
||||
tokio::spawn(async move {
|
||||
console::start_static_file_server(&opt.console_address).await;
|
||||
});
|
||||
}
|
||||
|
||||
tokio::select! {
|
||||
_ = tokio::signal::ctrl_c() => {
|
||||
|
||||
Reference in New Issue
Block a user