Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ipc-channel"
version = "0.22.0"
version = "0.23.0"
description = "A multiprocess drop-in replacement for Rust channels"
authors = ["The Servo Project Developers"]
license = "MIT OR Apache-2.0"
Expand Down Expand Up @@ -42,7 +42,7 @@ crossbeam-channel = "0.5"
futures-channel = { version = "0.3.32", optional = true }
futures-core = { version = "0.3.32", optional = true }
libc = "0.2.162"
postcard = {version = "1.1", default-features = false, features = ["use-std"]}
postcard = { version = "1.1", default-features = false, features = ["use-std"] }
serde_core = "1.0"
thiserror = "2.0.12"
uuid = { version = "1", features = ["v4"] }
Expand All @@ -53,18 +53,18 @@ rustc-hash = "2.1"
tempfile = "3.4"

[target.'cfg(target_os = "macos")'.dependencies]
rand = "0.9"
rand = "0.10"

[dev-dependencies]
serde = { version = "1.0", features = ["rc"] }
crossbeam-utils = "0.8"
futures-test = "0.3"
static_assertions = "1.1.0"
criterion = { version = "0.5", features = ["html_reports"] }
rand = "0.9.2"
rand = "0.10"

[target.'cfg(target_os = "windows")'.dependencies.windows]
version = "0.61"
version = "0.62"
Comment thread
sagudev marked this conversation as resolved.
features = [
"Win32_Foundation",
"Win32_System_WindowsProgramming",
Expand Down
2 changes: 1 addition & 1 deletion src/platform/macos/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use self::mach_sys::{mach_port_right_t, mach_port_t, mach_task_self_, vm_inherit
use crate::ipc::IpcMessage;

use libc::{self, c_char, c_uint, c_void, size_t};
use rand::{self, Rng};
use rand::{self, RngExt};
use std::cell::Cell;
use std::convert::TryInto;
use std::ffi::CString;
Expand Down
16 changes: 8 additions & 8 deletions src/platform/windows/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@ fn write_buf(handle: &WinHandle, bytes: &[u8], atomic: AtomicMode) -> Result<(),
sz,
written,
total,
WinError::from_win32()
WinError::from_thread()
);
},
}
Expand Down Expand Up @@ -1482,21 +1482,21 @@ impl OsIpcSender {
full_message.extend_from_slice(header_bytes);
}

if big_data_sender.is_none() {
full_message.extend_from_slice(data);
if let Some(big_data_sender) = big_data_sender {
full_message.extend_from_slice(&oob_data);
assert!(full_message.len() == full_in_band_len);

// Write needs to be atomic, since otherwise concurrent sending
// could result in parts of different messages getting intermixed,
// and the receiver would not be able to extract the individual messages.
write_buf(&self.handle, &full_message, AtomicMode::Atomic)?;
big_data_sender.send_raw(data)?;
} else {
full_message.extend_from_slice(data);
full_message.extend_from_slice(&oob_data);
assert!(full_message.len() == full_in_band_len);

// Write needs to be atomic, since otherwise concurrent sending
// could result in parts of different messages getting intermixed,
// and the receiver would not be able to extract the individual messages.
write_buf(&self.handle, &full_message, AtomicMode::Atomic)?;
big_data_sender.unwrap().send_raw(data)?;
}

Ok(())
Expand Down Expand Up @@ -2022,7 +2022,7 @@ impl OsIpcSharedMemory {
unsafe {
let address = MapViewOfFile(handle.as_raw(), FILE_MAP_ALL_ACCESS, 0, 0, 0);
if address.Value.is_null() {
return Err(WinError::from_win32());
return Err(WinError::from_thread());
}

Ok(OsIpcSharedMemory {
Expand Down
6 changes: 3 additions & 3 deletions src/platform/windows/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use windows::Win32::Foundation::{
CloseHandle, CompareObjectHandles, ERROR_INVALID_HANDLE, HANDLE, INVALID_HANDLE_VALUE,
};
use windows::Win32::System::Memory::{CreateFileMappingA, PAGE_READWRITE};
use windows::Win32::System::Threading::{CreateEventA, GetCurrentProcessId};
use windows::Win32::System::Threading::CreateEventA;

#[test]
fn test_recover_handles_empty() {
Expand Down Expand Up @@ -38,7 +38,7 @@ fn test_recover_handles_duplicates_channel_handles() {
assert_eq!(oob.channel_handles.len(), 3);
for (i, handle) in oob.channel_handles.iter().enumerate() {
assert_ne!(*handle, handles[i]);
assert_ne!(*handle as isize, INVALID_HANDLE_VALUE.0 as isize);
assert_ne!(*handle, INVALID_HANDLE_VALUE.0 as isize);
}

// Clean up the handles
Expand Down Expand Up @@ -90,7 +90,7 @@ fn test_recover_handles_duplicates_shmem_handles() {
let mut oob = OutOfBandMessage {
target_process_id: std::process::id(),
channel_handles: vec![],
shmem_handles: handles.clone().into_iter().zip(sizes.into_iter()).collect(),
shmem_handles: handles.clone().into_iter().zip(sizes).collect(),
big_data_receiver_handle: None,
};

Expand Down
Loading