aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock28
m---------libs/hbb_common0
-rw-r--r--src/rendezvous_server.rs12
3 files changed, 20 insertions, 20 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 77c9524..ab96637 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -172,8 +172,8 @@ dependencies = [
"env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"futures 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "protobuf 2.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "protobuf-codegen-pure 2.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "protobuf 3.0.0-pre (git+https://github.com/stepancheg/rust-protobuf)",
+ "protobuf-codegen-pure 3.0.0-pre (git+https://github.com/stepancheg/rust-protobuf)",
"socket2 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-util 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -364,24 +364,24 @@ dependencies = [
[[package]]
name = "protobuf"
-version = "2.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
+version = "3.0.0-pre"
+source = "git+https://github.com/stepancheg/rust-protobuf#bd2bc3bdbf52bd9bbc700e67f1fdaa95465b0ccb"
[[package]]
name = "protobuf-codegen"
-version = "2.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
+version = "3.0.0-pre"
+source = "git+https://github.com/stepancheg/rust-protobuf#bd2bc3bdbf52bd9bbc700e67f1fdaa95465b0ccb"
dependencies = [
- "protobuf 2.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "protobuf 3.0.0-pre (git+https://github.com/stepancheg/rust-protobuf)",
]
[[package]]
name = "protobuf-codegen-pure"
-version = "2.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
+version = "3.0.0-pre"
+source = "git+https://github.com/stepancheg/rust-protobuf#bd2bc3bdbf52bd9bbc700e67f1fdaa95465b0ccb"
dependencies = [
- "protobuf 2.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "protobuf-codegen 2.10.2 (registry+https://github.com/rust-lang/crates.io-index)",
+ "protobuf 3.0.0-pre (git+https://github.com/stepancheg/rust-protobuf)",
+ "protobuf-codegen 3.0.0-pre (git+https://github.com/stepancheg/rust-protobuf)",
]
[[package]]
@@ -637,9 +637,9 @@ dependencies = [
"checksum proc-macro-hack 0.5.11 (registry+https://github.com/rust-lang/crates.io-index)" = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5"
"checksum proc-macro-nested 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e"
"checksum proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435"
-"checksum protobuf 2.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "37a5325d019a4d837d3abde0a836920f959e33d350f77b5f1e289e061e774942"
-"checksum protobuf-codegen 2.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "64dd3a6192e0c6c1b0dae8f125b7f6b201c39fc487ebda0ee717d7a87fc47dc2"
-"checksum protobuf-codegen-pure 2.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "037fa49710ee83b3be232ed53c5fce0bdb1b64c6aa6b1143a86640969c3e4b1d"
+"checksum protobuf 3.0.0-pre (git+https://github.com/stepancheg/rust-protobuf)" = "<none>"
+"checksum protobuf-codegen 3.0.0-pre (git+https://github.com/stepancheg/rust-protobuf)" = "<none>"
+"checksum protobuf-codegen-pure 3.0.0-pre (git+https://github.com/stepancheg/rust-protobuf)" = "<none>"
"checksum quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
"checksum quote 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe"
"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84"
diff --git a/libs/hbb_common b/libs/hbb_common
-Subproject 9a2d8c3925eb69c76aba9f798fdc84a40aa68e8
+Subproject 9cccda60ea8d9e7006b2f5f35898e39c77a6c8d
diff --git a/src/rendezvous_server.rs b/src/rendezvous_server.rs
index 8e4bf26..e75f993 100644
--- a/src/rendezvous_server.rs
+++ b/src/rendezvous_server.rs
@@ -43,7 +43,7 @@ impl RendezvousServer {
) -> ResultType<()> {
if let Ok(msg_in) = parse_from_bytes::<RendezvousMessage>(&bytes) {
match msg_in.union {
- Some(RendezvousMessage_oneof_union::register_peer(rp)) => {
+ Some(rendezvous_message::Union::register_peer(rp)) => {
// B registered
if rp.id.len() > 0 {
log::debug!("New peer registered: {:?} {:?}", &rp.id, &addr);
@@ -53,7 +53,7 @@ impl RendezvousServer {
socket.send(&msg_out, addr).await?
}
}
- Some(RendezvousMessage_oneof_union::punch_hole_request(ph)) => {
+ Some(rendezvous_message::Union::punch_hole_request(ph)) => {
// punch hole request from A, forward to B,
// check if in same intranet first,
// fetch local addrs if in same intranet.
@@ -99,13 +99,13 @@ impl RendezvousServer {
} else {
let mut msg_out = RendezvousMessage::new();
msg_out.set_punch_hole_response(PunchHoleResponse {
- failure: PunchHoleResponse_Failure::ID_NOT_EXIST,
+ failure: punch_hole_response::Failure::ID_NOT_EXIST.into(),
..Default::default()
});
socket.send(&msg_out, addr).await?
}
}
- Some(RendezvousMessage_oneof_union::punch_hole_sent(phs)) => {
+ Some(rendezvous_message::Union::punch_hole_sent(phs)) => {
// punch hole sent from B, tell A that B is ready to be connected
let addr_a = AddrMangle::decode(&phs.socket_addr);
log::debug!("Punch hole response to {:?} from {:?}", &addr_a, &addr);
@@ -116,7 +116,7 @@ impl RendezvousServer {
});
socket.send(&msg_out, addr_a).await?;
}
- Some(RendezvousMessage_oneof_union::local_addr(la)) => {
+ Some(rendezvous_message::Union::local_addr(la)) => {
// forward local addrs of B to A
let addr_a = AddrMangle::decode(&la.socket_addr);
log::debug!("Local addrs response to {:?} from {:?}", &addr_a, &addr);
@@ -137,7 +137,7 @@ impl RendezvousServer {
#[cfg(test)]
mod tests {
use super::*;
- use hbb_common::{tokio};
+ use hbb_common::tokio;
#[allow(unused_must_use)]
#[tokio::main]