LibCore: Make ProxyData::port a u16
TCP ports are always u16 and this prevents invalid values from getting into this field somehow.
This commit is contained in:
parent
b4cbd321d9
commit
2a6045833c
2 changed files with 2 additions and 2 deletions
|
|
@ -21,7 +21,7 @@ struct ProxyData {
|
|||
} type { Type::Direct };
|
||||
|
||||
IPv4Address host_ipv4;
|
||||
int port { 0 };
|
||||
u16 port { 0 };
|
||||
|
||||
bool operator==(ProxyData const& other) const = default;
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ ErrorOr<Core::ProxyData> decode(Decoder& decoder)
|
|||
{
|
||||
auto type = TRY(decoder.decode<Core::ProxyData::Type>());
|
||||
auto host_ipv4 = IPv4Address(TRY(decoder.decode<u32>()));
|
||||
auto port = TRY(decoder.decode<int>());
|
||||
auto port = TRY(decoder.decode<u16>());
|
||||
|
||||
return Core::ProxyData { type, host_ipv4, port };
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue