|
|
@@ -164,6 +164,7 @@ impl RendezvousServer {
|
|
164
|
164
|
software_url: String,
|
|
165
|
165
|
key: &str,
|
|
166
|
166
|
stop: Arc<Mutex<bool>>,
|
|
|
167
|
+ id_change_support: bool,
|
|
167
|
168
|
) -> ResultType<()> {
|
|
168
|
169
|
if !key.is_empty() {
|
|
169
|
170
|
log::info!("Key: {}", key);
|
|
|
@@ -171,6 +172,7 @@ impl RendezvousServer {
|
|
171
|
172
|
log::info!("Listening on tcp/udp {}", addr);
|
|
172
|
173
|
log::info!("Listening on tcp {}, extra port for NAT test", addr2);
|
|
173
|
174
|
log::info!("relay-servers={:?}", relay_servers);
|
|
|
175
|
+ log::info!("change-id={:?}", id_change_support);
|
|
174
|
176
|
let mut socket = FramedSocket::new(addr).await?;
|
|
175
|
177
|
let (tx, mut rx) = mpsc::unbounded_channel::<(RendezvousMessage, SocketAddr)>();
|
|
176
|
178
|
let version = hbb_common::get_version_from_url(&software_url);
|
|
|
@@ -202,6 +204,7 @@ impl RendezvousServer {
|
|
202
|
204
|
&mut socket,
|
|
203
|
205
|
key,
|
|
204
|
206
|
stop.clone(),
|
|
|
207
|
+ id_change_support,
|
|
205
|
208
|
)
|
|
206
|
209
|
.await;
|
|
207
|
210
|
}
|
|
|
@@ -215,6 +218,7 @@ impl RendezvousServer {
|
|
215
|
218
|
socket: &mut FramedSocket,
|
|
216
|
219
|
key: &str,
|
|
217
|
220
|
stop: Arc<Mutex<bool>>,
|
|
|
221
|
+ id_change_support: bool,
|
|
218
|
222
|
) {
|
|
219
|
223
|
let mut timer = interval(Duration::from_millis(100));
|
|
220
|
224
|
loop {
|
|
|
@@ -326,7 +330,9 @@ impl RendezvousServer {
|
|
326
|
330
|
break;
|
|
327
|
331
|
}
|
|
328
|
332
|
let mut res = register_pk_response::Result::OK;
|
|
329
|
|
- if let Some(peer) = rs.pm.get(&rk.id).await {
|
|
|
333
|
+ if !id_change_support {
|
|
|
334
|
+ res = register_pk_response::Result::NOT_SUPPORT;
|
|
|
335
|
+ } else if let Some(peer) = rs.pm.get(&rk.id).await {
|
|
330
|
336
|
if peer.uuid != rk.uuid {
|
|
331
|
337
|
res = register_pk_response::Result::ID_EXISTS;
|
|
332
|
338
|
}
|