mirror of
https://github.com/TelegramMessenger/Telegram-iOS.git
synced 2026-07-06 03:33:41 +02:00
Merge 5a78f4fb80 into 6e370e06d1
This commit is contained in:
commit
34ff03221d
1 changed files with 14 additions and 3 deletions
|
|
@ -1438,11 +1438,22 @@ struct ctr_state {
|
|||
req.Version = 5;
|
||||
req.Cmd = 1;
|
||||
req.Reserved = 0;
|
||||
req.AddrType = 1;
|
||||
|
||||
struct in_addr ip4;
|
||||
inet_aton(_scheme.address.ip.UTF8String, &ip4);
|
||||
req.DestAddr.IPv4 = ip4;
|
||||
struct in6_addr ip6;
|
||||
|
||||
if (inet_aton(_scheme.address.ip.UTF8String, &ip4) == 1) {
|
||||
req.DestAddr.IPv4 = ip4;
|
||||
req.AddrType = 1;
|
||||
} else if (inet_pton(AF_INET6, _scheme.address.ip.UTF8String, &ip6) == 1) {
|
||||
req.DestAddr.IPv6 = ip6;
|
||||
req.AddrType = 4;
|
||||
} else {
|
||||
[_scheme.address.ip getCString:req.DestAddr.Domain maxLength:sizeof(req.DestAddr.Domain) encoding:NSASCIIStringEncoding];
|
||||
req.DestAddr.DomainLen = _scheme.address.ip.length;
|
||||
req.AddrType = 3;
|
||||
}
|
||||
|
||||
req.DestPort = _scheme.address.port;
|
||||
|
||||
NSMutableData *reqData = [[NSMutableData alloc] init];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue