mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Tunnel config loading moved to lib part
This commit is contained in:
parent
eb479c81e0
commit
be71eedc4b
1 changed files with 3 additions and 9 deletions
|
@ -119,19 +119,13 @@ void UdpServerTunnelImpl::start_up() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto tunnel_conf_data_R = td::read_file(tunnel_config_);
|
|
||||||
if (tunnel_conf_data_R.is_error()) {
|
|
||||||
LOG(FATAL) << tunnel_conf_data_R.move_as_error_prefix("failed to read tunnel config: ");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto global_cfg = global_conf_data_R.move_as_ok();
|
auto global_cfg = global_conf_data_R.move_as_ok();
|
||||||
auto tunnel_cfg = tunnel_conf_data_R.move_as_ok();
|
|
||||||
|
|
||||||
LOG(INFO) << "Initializing ADNL Tunnel...";
|
LOG(INFO) << "Initializing ADNL Tunnel...";
|
||||||
const auto res = PrepareTunnel(&on_recv_batch, &on_reinit, callback_.get(), callback_.get(), const_cast<char*>(tunnel_cfg.data()), tunnel_cfg.size(), global_cfg.data(), global_cfg.size());
|
const auto res = PrepareTunnel(&on_recv_batch, &on_reinit, callback_.get(), callback_.get(), tunnel_config_.data(), tunnel_config_.size(), global_cfg.data(), global_cfg.size());
|
||||||
if (!res.index) {
|
if (!res.index) {
|
||||||
LOG(FATAL) << "ADNL Tunnel initialization failed";
|
// the reason will be displayed in logs from lib part
|
||||||
|
exit(1);
|
||||||
}
|
}
|
||||||
tunnel_index_ = res.index;
|
tunnel_index_ = res.index;
|
||||||
LOG(INFO) << "ADNL Tunnel Initialized";
|
LOG(INFO) << "ADNL Tunnel Initialized";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue