mirror of
https://github.com/wiz0u/WTelegramClient.git
synced 2026-01-23 08:50:24 +01:00
fix issue with MTProxy and media dc_id
This commit is contained in:
parent
b1c8d225f2
commit
f620514759
|
|
@ -355,7 +355,7 @@ namespace WTelegram
|
|||
|
||||
internal IObject ReadFrame(byte[] data, int dataLen)
|
||||
{
|
||||
if (dataLen == 4 && data[3] == 0xFF)
|
||||
if (dataLen < 8 && data[3] == 0xFF)
|
||||
{
|
||||
int error_code = -BinaryPrimitives.ReadInt32LittleEndian(data);
|
||||
throw new RpcException(error_code, TransportError(error_code));
|
||||
|
|
@ -448,6 +448,7 @@ namespace WTelegram
|
|||
{
|
||||
404 => "Auth key not found",
|
||||
429 => "Transport flood",
|
||||
444 => "Invalid DC",
|
||||
_ => Enum.GetName(typeof(HttpStatusCode), error_code) ?? "Transport error"
|
||||
};
|
||||
}
|
||||
|
|
@ -708,7 +709,7 @@ namespace WTelegram
|
|||
if (MTProxyUrl != null)
|
||||
{
|
||||
#if OBFUSCATION
|
||||
if (!IsMainDC) dcId = -dcId;
|
||||
if (_dcSession.DataCenter?.flags.HasFlag(DcOption.Flags.media_only) == true) dcId = -dcId;
|
||||
var parms = HttpUtility.ParseQueryString(MTProxyUrl[MTProxyUrl.IndexOf('?')..]);
|
||||
var server = parms["server"];
|
||||
int port = int.Parse(parms["port"]);
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ namespace WTelegram
|
|||
new_nonce = new Int256(RNG),
|
||||
dc = session.DataCenter?.id ?? 0
|
||||
};
|
||||
if (session.DataCenter?.flags.HasFlag(DcOption.Flags.media_only) == true) pqInnerData.dc = -pqInnerData.dc;
|
||||
byte[] encrypted_data = null;
|
||||
{
|
||||
//4.1) RSA_PAD(data, server_public_key)
|
||||
|
|
|
|||
Loading…
Reference in a new issue