ssfpc.inc fixes by ACBr

git-svn-id: https://svn.code.sf.net/p/synalist/code/trunk@242 7c85be65-684b-0410-a082-b2ed4fbef004
This commit is contained in:
geby 2022-01-08 17:12:50 +00:00
parent 8414d7b862
commit 009ef79a18

View File

@ -364,7 +364,7 @@ type
case sin_family: sa_family_t of
AF_INET: (sin_port: word;
sin_addr: TInAddr;
sin_zero: array[0..7] of Char);
sin_zero: array[0..7] of byte);
AF_INET6: (sin6_port: word;
sin6_flowinfo: longword;
sin6_addr: TInAddr6;
@ -513,9 +513,9 @@ function SizeOfVarSin(sin: TVarSin): integer;
begin
case sin.sin_family of
AF_INET:
Result := SizeOf(TSockAddrIn);
Result := SizeOf(TSockAddrIn);
AF_INET6:
Result := SizeOf(TSockAddrIn6);
Result := SizeOf(TSockAddrIn6);
else
Result := 0;
end;
@ -861,10 +861,12 @@ begin
if Result = 0 then
begin
ProtoEnt.Name := '';
GetProtocolByNumber(SockProtocol, ProtoEnt);
ServEnt.port := 0;
GetServiceByName(Port, ProtoEnt.Name, ServEnt);
Result := synsock.ntohs(ServEnt.port);
if GetProtocolByNumber(SockProtocol, ProtoEnt) then
begin
ServEnt.port := 0;
if GetServiceByName(Port, ProtoEnt.Name, ServEnt) then
Result := synsock.ntohs(ServEnt.port);
end;
end;
end;