Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3382978
D5011.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D5011.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
Fri, Nov 29, 12:57 PM (20 h, 18 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2597060
Default Alt Text
D5011.diff (1 KB)
Attached To
Mode
D5011: [services] Backup - Blob Put Client - Add write
Attached
Detach File
Event Timeline
Log In to Comment