Fix testProxy.

GitOrigin-RevId: fcce1611113bec089ac3ca20df56eba85895a753
This commit is contained in:
levlam 2019-07-23 01:13:20 +03:00
parent 410d81c55f
commit 4a2b76e1ef
3 changed files with 5 additions and 4 deletions

View File

@ -55,7 +55,7 @@ void HandshakeActor::return_connection(Status status) {
CHECK(!raw_connection_promise_); CHECK(!raw_connection_promise_);
return; return;
} }
if (status.is_error()) { if (status.is_error() && !raw_connection->debug_str_.empty()) {
status = Status::Error(status.code(), PSLICE() << status.message() << " : " << raw_connection->debug_str_); status = Status::Error(status.code(), PSLICE() << status.message() << " : " << raw_connection->debug_str_);
} }
Scheduler::unsubscribe(raw_connection->get_poll_info().get_pollable_fd_ref()); Scheduler::unsubscribe(raw_connection->get_poll_info().get_pollable_fd_ref());

View File

@ -617,7 +617,7 @@ class TestProxyRequest : public RequestOnceActor {
} }
void on_handshake_connection(Result<unique_ptr<mtproto::RawConnection>> r_raw_connection) { void on_handshake_connection(Result<unique_ptr<mtproto::RawConnection>> r_raw_connection) {
if (r_raw_connection.is_error()) { if (r_raw_connection.is_error()) {
promise_.set_error(Status::Error(400, r_raw_connection.move_as_error().public_message())); return promise_.set_error(Status::Error(400, r_raw_connection.move_as_error().public_message()));
} }
} }
void on_handshake(Result<unique_ptr<mtproto::AuthKeyHandshake>> r_handshake) { void on_handshake(Result<unique_ptr<mtproto::AuthKeyHandshake>> r_handshake) {
@ -625,13 +625,14 @@ class TestProxyRequest : public RequestOnceActor {
return; return;
} }
if (r_handshake.is_error()) { if (r_handshake.is_error()) {
promise_.set_error(Status::Error(400, r_handshake.move_as_error().public_message())); return promise_.set_error(Status::Error(400, r_handshake.move_as_error().public_message()));
} }
auto handshake = r_handshake.move_as_ok(); auto handshake = r_handshake.move_as_ok();
if (!handshake->is_ready_for_finish()) { if (!handshake->is_ready_for_finish()) {
promise_.set_error(Status::Error(400, "Handshake is not ready")); promise_.set_error(Status::Error(400, "Handshake is not ready"));
} }
promise_.set_value(Unit());
} }
public: public:

View File

@ -131,7 +131,7 @@ void Wget::start_up() {
} }
void Wget::timeout_expired() { void Wget::timeout_expired() {
on_error(Status::Error("Timeout expired")); on_error(Status::Error("Response timeout expired"));
} }
void Wget::tear_down() { void Wget::tear_down() {