Skip to content

Commit

Permalink
Merge branch 'main' into eclipse-zenoh-bot/post-release-1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrik authored Feb 14, 2025
2 parents 0092273 + 321c499 commit a0dc8d1
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 13 deletions.
5 changes: 1 addition & 4 deletions build-resources/opaque-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
shared-memory = [
"zenoh/shared-memory",
"zenoh-protocol/shared-memory",
]
shared-memory = ["zenoh/shared-memory", "zenoh-protocol/shared-memory"]
unstable = ["zenoh/unstable", "zenoh-ext/unstable"]
auth_pubkey = ["zenoh/auth_pubkey"]
auth_usrpwd = ["zenoh/auth_usrpwd"]
Expand Down
15 changes: 15 additions & 0 deletions include/zenoh_commons.h
Original file line number Diff line number Diff line change
Expand Up @@ -2969,6 +2969,21 @@ ZENOHC_API bool z_internal_config_check(const struct z_owned_config_t *this_);
* Constructs config in its gravestone state.
*/
ZENOHC_API void z_internal_config_null(struct z_owned_config_t *this_);
/**
* Returns the default congestion control value of zenoh push network messages, typically used for put operations.
*/
ZENOHC_API
enum z_congestion_control_t z_internal_congestion_control_default_push(void);
/**
* Returns the default congestion control value of zenoh request network messages, typically used for get operations.
*/
ZENOHC_API
enum z_congestion_control_t z_internal_congestion_control_default_request(void);
/**
* Returns the default congestion control value of zenoh response network messages, typically used for reply operations.
*/
ZENOHC_API
enum z_congestion_control_t z_internal_congestion_control_default_response(void);
/**
* Returns ``true`` if encoding is in non-default state, ``false`` otherwise.
*/
Expand Down
2 changes: 1 addition & 1 deletion include/zenoh_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// ZettaScale Zenoh Team, <[email protected]>
#pragma once

#define Z_CONGESTION_CONTROL_DEFAULT Z_CONGESTION_CONTROL_BLOCK
#define Z_CONGESTION_CONTROL_DEFAULT Z_CONGESTION_CONTROL_DROP
#define Z_CONSOLIDATION_MODE_DEFAULT Z_CONSOLIDATION_MODE_AUTO
#define Z_PRIORITY_DEFAULT Z_PRIORITY_DATA
#define Z_QUERY_TARGET_DEFAULT Z_QUERY_TARGET_BEST_MATCHING
Expand Down
2 changes: 1 addition & 1 deletion src/advanced_publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ impl Default for ze_advanced_publisher_cache_options_t {
Self {
is_enabled: true,
max_samples: 1,
congestion_control: CongestionControl::default().into(),
congestion_control: CongestionControl::DEFAULT_PUSH.into(),
priority: Priority::default().into(),
is_express: false,
}
Expand Down
18 changes: 18 additions & 0 deletions src/commons.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,24 @@ pub enum z_congestion_control_t {
DROP,
}

/// Returns the default congestion control value of zenoh push network messages, typically used for put operations.
#[no_mangle]
pub extern "C" fn z_internal_congestion_control_default_push() -> z_congestion_control_t {
CongestionControl::DEFAULT_PUSH.into()
}

/// Returns the default congestion control value of zenoh request network messages, typically used for get operations.
#[no_mangle]
pub extern "C" fn z_internal_congestion_control_default_request() -> z_congestion_control_t {
CongestionControl::DEFAULT_REQUEST.into()
}

/// Returns the default congestion control value of zenoh response network messages, typically used for reply operations.
#[no_mangle]
pub extern "C" fn z_internal_congestion_control_default_response() -> z_congestion_control_t {
CongestionControl::DEFAULT_RESPONSE.into()
}

impl From<CongestionControl> for z_congestion_control_t {
fn from(cc: CongestionControl) -> Self {
match cc {
Expand Down
2 changes: 1 addition & 1 deletion src/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ pub extern "C" fn z_get_options_default(this_: &mut MaybeUninit<z_get_options_t>
this_.write(z_get_options_t {
target: QueryTarget::default().into(),
consolidation: QueryConsolidation::default().into(),
congestion_control: CongestionControl::default().into(),
congestion_control: CongestionControl::DEFAULT_REQUEST.into(),
#[cfg(feature = "unstable")]
allowed_destination: zc_locality_default(),
#[cfg(feature = "unstable")]
Expand Down
2 changes: 1 addition & 1 deletion src/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl Default for z_publisher_options_t {
fn default() -> Self {
Self {
encoding: None,
congestion_control: CongestionControl::default().into(),
congestion_control: CongestionControl::DEFAULT_PUSH.into(),
priority: Priority::default().into(),
is_express: false,
#[cfg(feature = "unstable")]
Expand Down
4 changes: 2 additions & 2 deletions src/put.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub struct z_put_options_t {
pub extern "C" fn z_put_options_default(this_: &mut MaybeUninit<z_put_options_t>) {
this_.write(z_put_options_t {
encoding: None,
congestion_control: CongestionControl::default().into(),
congestion_control: CongestionControl::DEFAULT_PUSH.into(),
priority: Priority::default().into(),
is_express: false,
timestamp: None,
Expand Down Expand Up @@ -164,7 +164,7 @@ pub struct z_delete_options_t {
#[allow(clippy::missing_safety_doc)]
pub unsafe extern "C" fn z_delete_options_default(this_: &mut MaybeUninit<z_delete_options_t>) {
this_.write(z_delete_options_t {
congestion_control: CongestionControl::default().into(),
congestion_control: CongestionControl::DEFAULT_PUSH.into(),
priority: Priority::default().into(),
is_express: false,
timestamp: None,
Expand Down
2 changes: 1 addition & 1 deletion src/querier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub extern "C" fn z_querier_options_default(this_: &mut MaybeUninit<z_querier_op
this_.write(z_querier_options_t {
target: QueryTarget::default().into(),
consolidation: QueryConsolidation::default().into(),
congestion_control: CongestionControl::default().into(),
congestion_control: CongestionControl::DEFAULT_REQUEST.into(),
priority: Priority::default().into(),
is_express: false,
#[cfg(feature = "unstable")]
Expand Down
4 changes: 2 additions & 2 deletions src/queryable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ pub struct z_query_reply_options_t {
pub extern "C" fn z_query_reply_options_default(this_: &mut MaybeUninit<z_query_reply_options_t>) {
this_.write(z_query_reply_options_t {
encoding: None,
congestion_control: CongestionControl::Block.into(),
congestion_control: CongestionControl::DEFAULT_RESPONSE.into(),
priority: Priority::default().into(),
is_express: false,
timestamp: None,
Expand Down Expand Up @@ -209,7 +209,7 @@ pub extern "C" fn z_query_reply_del_options_default(
this: &mut MaybeUninit<z_query_reply_del_options_t>,
) {
this.write(z_query_reply_del_options_t {
congestion_control: CongestionControl::Block.into(),
congestion_control: CongestionControl::DEFAULT_RESPONSE.into(),
priority: Priority::default().into(),
is_express: false,
timestamp: None,
Expand Down

0 comments on commit a0dc8d1

Please sign in to comment.