Fix raw_dc_id for test DC.

GitOrigin-RevId: 2fd4d78700d245b91a6b390df26568d910cbae37
This commit is contained in:
levlam 2018-05-17 22:09:57 +03:00
parent e29f883c8f
commit d9a89abd23

View File

@ -651,7 +651,11 @@ void ConnectionCreator::client_loop(ClientInfo &client) {
auto r_socket_fd = [&, dc_id = client.dc_id]() -> Result<SocketFd> {
TRY_RESULT(info, dc_options_set_.find_connection(dc_id, allow_media_only, use_proxy));
stat = info.stat;
int16 raw_dc_id = narrow_cast<int16>(info.option->is_media_only() ? -dc_id.get_raw_id() : dc_id.get_raw_id());
int32 int_dc_id = dc_id.get_raw_id();
if (G()->is_test_dc()) {
int_dc_id += 10000;
}
int16 raw_dc_id = narrow_cast<int16>(info.option->is_media_only() ? -int_dc_id : int_dc_id);
if (use_mtproto_proxy) {
TRY_RESULT(secret, hex_decode(proxy->secret()));