mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Tonproxy improvements (#483)
* Bugfixes in rldp-http-proxy and http parser * Tonlib: change liteservers on query timeout or connection close * Increase maximum size of http request * Minor bugfixes in http
This commit is contained in:
parent
cc9ce0eb28
commit
caffdbb5ba
23 changed files with 158 additions and 77 deletions
|
@ -80,6 +80,9 @@ class AdnlExtClientImpl : public AdnlExtClient {
|
|||
if (!conn_.empty() && conn_.get() == conn) {
|
||||
callback_->on_stop_ready();
|
||||
conn_ = {};
|
||||
for (auto& q : out_queries_) {
|
||||
td::actor::send_closure(q.second, &AdnlQuery::set_error, td::Status::Error(ErrorCode::cancelled));
|
||||
}
|
||||
alarm_timestamp() = next_create_at_;
|
||||
try_stop();
|
||||
}
|
||||
|
|
|
@ -25,13 +25,16 @@ namespace ton {
|
|||
namespace adnl {
|
||||
|
||||
void AdnlQuery::alarm() {
|
||||
promise_.set_error(td::Status::Error(ErrorCode::timeout, "adnl query timeout"));
|
||||
stop();
|
||||
set_error(td::Status::Error(ErrorCode::timeout, "adnl query timeout"));
|
||||
}
|
||||
void AdnlQuery::result(td::BufferSlice data) {
|
||||
promise_.set_value(std::move(data));
|
||||
stop();
|
||||
}
|
||||
void AdnlQuery::set_error(td::Status error) {
|
||||
promise_.set_error(std::move(error));
|
||||
stop();
|
||||
}
|
||||
|
||||
AdnlQueryId AdnlQuery::random_query_id() {
|
||||
AdnlQueryId q_id;
|
||||
|
|
|
@ -48,6 +48,7 @@ class AdnlQuery : public td::actor::Actor {
|
|||
}
|
||||
void alarm() override;
|
||||
void result(td::BufferSlice data);
|
||||
void set_error(td::Status error);
|
||||
void start_up() override {
|
||||
alarm_timestamp() = timeout_;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue