provide more context when dyn-ip server is unreachable
This commit is contained in:
parent
6c89b9c040
commit
91eebb2c5d
10
src/main.rs
10
src/main.rs
@ -12,7 +12,7 @@ use std::{
|
|||||||
time::{Duration, SystemTime, UNIX_EPOCH},
|
time::{Duration, SystemTime, UNIX_EPOCH},
|
||||||
};
|
};
|
||||||
|
|
||||||
use anyhow::{anyhow, bail};
|
use anyhow::{anyhow, bail, Context};
|
||||||
use packets::{Header, Packet, RemConnect};
|
use packets::{Header, Packet, RemConnect};
|
||||||
use serde::{Deserialize, Deserializer, Serialize};
|
use serde::{Deserialize, Deserializer, Serialize};
|
||||||
use tokio::{
|
use tokio::{
|
||||||
@ -409,7 +409,9 @@ async fn connection_handler(
|
|||||||
|
|
||||||
// make sure the client is authenticated before opening any ports
|
// make sure the client is authenticated before opening any ports
|
||||||
if !authenticated {
|
if !authenticated {
|
||||||
let _ip = dyn_ip_update(&config.dyn_ip_server, number, pin, port).await?;
|
let _ip = dyn_ip_update(&config.dyn_ip_server, number, pin, port)
|
||||||
|
.await
|
||||||
|
.context("dy-ip update")?;
|
||||||
authenticated = true;
|
authenticated = true;
|
||||||
updated_server = true;
|
updated_server = true;
|
||||||
}
|
}
|
||||||
@ -432,7 +434,9 @@ async fn connection_handler(
|
|||||||
// we need to update the server here once a port that can be opened
|
// we need to update the server here once a port that can be opened
|
||||||
// has been found
|
// has been found
|
||||||
if !updated_server {
|
if !updated_server {
|
||||||
let _ip = dyn_ip_update(&config.dyn_ip_server, number, pin, port).await?;
|
let _ip = dyn_ip_update(&config.dyn_ip_server, number, pin, port)
|
||||||
|
.await
|
||||||
|
.context("dy-ip update")?;
|
||||||
}
|
}
|
||||||
|
|
||||||
port_handler
|
port_handler
|
||||||
|
Loading…
Reference in New Issue
Block a user