mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-13 18:11:22 +00:00
feat: migrate to quick-protobuf
Instead of relying on `protoc` and buildscripts, we generate the bindings using `pb-rs` and version them within our codebase. This makes for a better IDE integration, a faster build and an easier use of `rust-libp2p` because we don't force the `protoc` dependency onto them. Resolves #3024. Pull-Request: #3312.
This commit is contained in:
@ -20,7 +20,7 @@
|
||||
|
||||
use crate::behaviour::CircuitId;
|
||||
use crate::copy_future::CopyFuture;
|
||||
use crate::message_proto::Status;
|
||||
use crate::proto;
|
||||
use crate::protocol::{inbound_hop, outbound_stop};
|
||||
use bytes::Bytes;
|
||||
use either::Either;
|
||||
@ -58,12 +58,12 @@ pub enum In {
|
||||
},
|
||||
DenyReservationReq {
|
||||
inbound_reservation_req: inbound_hop::ReservationReq,
|
||||
status: Status,
|
||||
status: proto::Status,
|
||||
},
|
||||
DenyCircuitReq {
|
||||
circuit_id: Option<CircuitId>,
|
||||
inbound_circuit_req: inbound_hop::CircuitReq,
|
||||
status: Status,
|
||||
status: proto::Status,
|
||||
},
|
||||
NegotiateOutboundConnect {
|
||||
circuit_id: CircuitId,
|
||||
@ -208,7 +208,7 @@ pub enum Event {
|
||||
src_peer_id: PeerId,
|
||||
src_connection_id: ConnectionId,
|
||||
inbound_circuit_req: inbound_hop::CircuitReq,
|
||||
status: Status,
|
||||
status: proto::Status,
|
||||
error: ConnectionHandlerUpgrErr<outbound_stop::CircuitFailedReason>,
|
||||
},
|
||||
/// An inbound circuit has closed.
|
||||
@ -522,12 +522,14 @@ impl Handler {
|
||||
>,
|
||||
) {
|
||||
let (non_fatal_error, status) = match error {
|
||||
ConnectionHandlerUpgrErr::Timeout => {
|
||||
(ConnectionHandlerUpgrErr::Timeout, Status::ConnectionFailed)
|
||||
}
|
||||
ConnectionHandlerUpgrErr::Timer => {
|
||||
(ConnectionHandlerUpgrErr::Timer, Status::ConnectionFailed)
|
||||
}
|
||||
ConnectionHandlerUpgrErr::Timeout => (
|
||||
ConnectionHandlerUpgrErr::Timeout,
|
||||
proto::Status::CONNECTION_FAILED,
|
||||
),
|
||||
ConnectionHandlerUpgrErr::Timer => (
|
||||
ConnectionHandlerUpgrErr::Timer,
|
||||
proto::Status::CONNECTION_FAILED,
|
||||
),
|
||||
ConnectionHandlerUpgrErr::Upgrade(upgrade::UpgradeError::Select(
|
||||
upgrade::NegotiationError::Failed,
|
||||
)) => {
|
||||
@ -556,10 +558,10 @@ impl Handler {
|
||||
outbound_stop::UpgradeError::CircuitFailed(error) => {
|
||||
let status = match error {
|
||||
outbound_stop::CircuitFailedReason::ResourceLimitExceeded => {
|
||||
Status::ResourceLimitExceeded
|
||||
proto::Status::RESOURCE_LIMIT_EXCEEDED
|
||||
}
|
||||
outbound_stop::CircuitFailedReason::PermissionDenied => {
|
||||
Status::PermissionDenied
|
||||
proto::Status::PERMISSION_DENIED
|
||||
}
|
||||
};
|
||||
(
|
||||
|
Reference in New Issue
Block a user