Skip to content

Commit 3ce976d

Browse files
authored
fix: public cbor/json codec module
follow-up to #5792 configuring a request_response behavior with generic codec does not allow for setting request/response size limits. e.g. the following fails to compile since `request_response::cbor::codec` is private: ```rust let non_default_codec = request_response::cbor::codec::Codec::<CustomRequest, CustomLargeResponse>::default() .set_response_size_maximum(large_response_size_max); let request_response = request_response::Behaviour::with_codec( non_default_codec, std::iter::once(( StreamProtocol::new("/request-response/1"), request_response::ProtocolSupport::Full, )), request_response::Config::default(), ); ``` Pull-Request: #5830.
1 parent fee8bf0 commit 3ce976d

File tree

6 files changed

+10
-5
lines changed

6 files changed

+10
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ libp2p-pnet = { version = "0.26.0", path = "transports/pnet" }
9696
libp2p-quic = { version = "0.12.0", path = "transports/quic" }
9797
libp2p-relay = { version = "0.19.1", path = "protocols/relay" }
9898
libp2p-rendezvous = { version = "0.16.0", path = "protocols/rendezvous" }
99-
libp2p-request-response = { version = "0.28.0", path = "protocols/request-response" }
99+
libp2p-request-response = { version = "0.28.1", path = "protocols/request-response" }
100100
libp2p-server = { version = "0.12.6", path = "misc/server" }
101101
libp2p-stream = { version = "0.3.0-alpha", path = "protocols/stream" }
102102
libp2p-swarm = { version = "0.46.0", path = "swarm" }

protocols/request-response/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.28.1
2+
3+
- fix: public cbor/json codec module
4+
See [PR 5830](https://github.com/libp2p/rust-libp2p/pull/5830).
5+
16
## 0.28.0
27

38
- Deprecate `void` crate.

protocols/request-response/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libp2p-request-response"
33
edition = "2021"
44
rust-version = { workspace = true }
55
description = "Generic Request/Response Protocols"
6-
version = "0.28.0"
6+
version = "0.28.1"
77
authors = ["Parity Technologies <[email protected]>"]
88
license = "MIT"
99
repository = "https://github.com/libp2p/rust-libp2p"

protocols/request-response/src/cbor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
/// ```
4747
pub type Behaviour<Req, Resp> = crate::Behaviour<codec::Codec<Req, Resp>>;
4848

49-
mod codec {
49+
pub mod codec {
5050
use std::{collections::TryReserveError, convert::Infallible, io, marker::PhantomData};
5151

5252
use async_trait::async_trait;

protocols/request-response/src/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
/// ```
4747
pub type Behaviour<Req, Resp> = crate::Behaviour<codec::Codec<Req, Resp>>;
4848

49-
mod codec {
49+
pub mod codec {
5050
use std::{io, marker::PhantomData};
5151

5252
use async_trait::async_trait;

0 commit comments

Comments
 (0)