Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F32509290
D5011.1767101388.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D5011.1767101388.diff
View Options
diff --git a/services/backup/blob_client/src/put_client.rs b/services/backup/blob_client/src/put_client.rs
--- a/services/backup/blob_client/src/put_client.rs
+++ b/services/backup/blob_client/src/put_client.rs
@@ -210,7 +210,36 @@
field_index: usize,
data: *const c_char,
) -> Result<(), String> {
- unimplemented!();
+ check_error()?;
+ let data_c_str: &CStr = unsafe { CStr::from_ptr(data) };
+ let data_bytes: Vec<u8> = data_c_str.to_bytes().to_vec();
+
+ RUNTIME.block_on(async {
+ if let Ok(mut maybe_client) = CLIENT.lock() {
+ if let Some(client) = (*maybe_client).take() {
+ match client
+ .tx
+ .send(PutRequestData {
+ field_index,
+ data: data_bytes,
+ })
+ .await
+ {
+ Ok(_) => (),
+ Err(err) => {
+ report_error(format!("send data to receiver failed: {}", err))
+ }
+ }
+ *maybe_client = Some(client);
+ } else {
+ report_error("no client detected".to_string());
+ }
+ } else {
+ report_error("couldn't access client".to_string());
+ }
+ });
+ check_error()?;
+ Ok(())
}
pub fn put_client_terminate_cxx() -> Result<(), String> {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 30, 1:29 PM (8 h, 50 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5867262
Default Alt Text
D5011.1767101388.diff (1 KB)
Attached To
Mode
D5011: [services] Backup - Blob Put Client - Add write
Attached
Detach File
Event Timeline
Log In to Comment