| 1024 | } |
| 1025 | |
| 1026 | void BaseRunner::receive_answer_from_connection(TcpClient::ConnectionId connection_id, |
| 1027 | td::Result<td::BufferSlice> result, |
| 1028 | td::Promise<td::BufferSlice> promise) { |
| 1029 | LOG(DEBUG) << "received answer from connection " << connection_id; |
| 1030 | auto it = all_connections_.find(connection_id); |
| 1031 | if (it == all_connections_.end()) { |
| 1032 | LOG(WARNING) << "received answer from unknown connection " << connection_id; |
| 1033 | return promise.set_error(td::Status::Error(ton::ErrorCode::cancelled, "connection is destroyed")); |
| 1034 | } |
| 1035 | it->second->received_answer(); |
| 1036 | |
| 1037 | promise.set_result(std::move(result)); |
| 1038 | } |
| 1039 | |
| 1040 | /* |
| 1041 | * |
nothing calls this directly
no test coverage detected