Skip to content

Commit 64d3146

Browse files
committed
feat: Add support for libc dependency and update listener mode type to libc::mode_t
1 parent ece17cd commit 64d3146

File tree

5 files changed

+14
-5
lines changed

5 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
89
## [0.3.0] - 2025-09-27
910

1011
### Added
@@ -13,12 +14,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1314
- Windows: Added `.with_listener_security_descriptor(sddl)` for custom named pipe security descriptors (e.g., `"D:(A;;GA;;;WD)"`).
1415
- **Dependency Update**
1516
- Added `widestring` dependency for Windows platform.
17+
- Added `libc` dependency for Unix platform.
1618

1719
### Changed
1820
- **IpcHttpServer / IpcStreamServer Construction Improvements**
1921
- Added `listener_options` field for customizable listener parameters.
2022
- **Example Code Enhancement**
2123
- Updated `examples/http_server.rs` and `examples/stream_server.rs` to demonstrate cross-platform permission settings.
24+
- **API Consistency and Documentation**
25+
- Improved documentation and examples for permission configuration methods.
26+
- Minor refactoring for consistency across server modules.
2227

2328
### Internal
2429
- **Code Structure Optimization**

Cargo.lock

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ pin-project-lite = "0.2.16"
3535
toml = "0.9.5"
3636
rand = "0.9.2"
3737

38+
[target.'cfg(unix)'.dependencies]
39+
libc = "0.2.176"
40+
3841
[target.'cfg(windows)'.dependencies]
3942
widestring = "1.2.0"
4043

src/ipc_http_server.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ impl IpcHttpServer {
517517
/// let server = IpcHttpServer::new("/tmp/my.sock").unwrap().with_listener_mode(0o660); // Only owner and group can read/write
518518
/// ```
519519
#[cfg(unix)]
520-
pub fn with_listener_mode(mut self, mode: u16) -> Self {
520+
pub fn with_listener_mode(mut self, mode: libc::mode_t) -> Self {
521521
self.listener_options = self.listener_options.mode(mode);
522522
self
523523
}
@@ -585,7 +585,7 @@ impl IpcHttpServer {
585585
}
586586

587587
let router = self.router.clone();
588-
let config = self.config.clone();
588+
let config = self.config;
589589
let stats = self.stats.clone();
590590
let connection_id = {
591591
let stats = self.stats.read();

src/ipc_stream_server.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ impl IpcStreamServer {
426426
/// let server = IpcStreamServer::new("/tmp/my.sock").unwrap().with_listener_mode(0o660); // Only owner and group can read/write
427427
/// ```
428428
#[cfg(unix)]
429-
pub fn with_listener_mode(mut self, mode: u16) -> Self {
429+
pub fn with_listener_mode(mut self, mode: libc::mode_t) -> Self {
430430
self.listener_options = self.listener_options.mode(mode);
431431
self
432432
}

0 commit comments

Comments
 (0)