代码拉取完成,页面将自动刷新
From 1044093af3d4e1db0ffa695bfaf5124f7589fa15 Mon Sep 17 00:00:00 2001
From: xuxuepeng <xuxuepeng1@huawei.com>
Date: Fri, 22 Nov 2024 02:51:29 +0800
Subject: [PATCH] change wait callback argument from u8 to c_char fix couples
of warnings as well
Signed-off-by: xuxuepeng <xuxuepeng1@huawei.com>
---
sandbox/src/controller/client.rs | 1 -
sandbox/src/lib.rs | 11 +++++------
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/sandbox/src/controller/client.rs b/sandbox/src/controller/client.rs
index c02954b..25377fd 100644
--- a/sandbox/src/controller/client.rs
+++ b/sandbox/src/controller/client.rs
@@ -32,7 +32,6 @@ use sandbox::containerd::services::sandbox::v1::ControllerUpdateRequest;
use sandbox::containerd::services::sandbox::v1::ControllerUpdateResponse;
use tonic::transport::Channel;
-use tower::ServiceExt;
#[derive(Debug, Clone)]
pub struct Client {
pub channel: Channel,
diff --git a/sandbox/src/lib.rs b/sandbox/src/lib.rs
index ac24c7d..1d2626c 100644
--- a/sandbox/src/lib.rs
+++ b/sandbox/src/lib.rs
@@ -16,8 +16,7 @@ mod datatype;
use controller::client;
use datatype::sandbox_types;
use tokio::time::{ sleep, Duration };
-use std::os::raw::{c_char, c_int, c_void};
-use std::sync::{ Arc, Mutex };
+use std::os::raw::{c_char, c_int};
use lazy_static::lazy_static;
use tokio::runtime::Runtime;
use async_recursion::async_recursion;
@@ -228,9 +227,9 @@ pub unsafe extern "C" fn sandbox_api_update(
sandbox_api_execute!(controller_context, r_req, update)
}
-pub type SandboxReadyCallback = extern "C" fn(*const u8);
-pub type SandboxPendingCallback = extern "C" fn(*const u8);
-pub type SandboxExitCallback = extern "C" fn(*const u8, *const sandbox_types::SandboxWaitResponse);
+pub type SandboxReadyCallback = extern "C" fn(*const c_char);
+pub type SandboxPendingCallback = extern "C" fn(*const c_char);
+pub type SandboxExitCallback = extern "C" fn(*const c_char, *const sandbox_types::SandboxWaitResponse);
#[repr(C)]
pub struct SandboxWaitCallback {
@@ -269,7 +268,7 @@ pub async fn is_connection_alive(
match (*client).platform(r_req).await {
Ok(_) => true,
Err(e) => {
- println!("Sandbox API: Failed to connect to client, {:?}", sandbox_id);
+ println!("Sandbox API: Failed to connect to client, {:?}, {:?}", sandbox_id, e);
false
}
}
--
2.33.0
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。