sslinux.inc improved by ACBr
git-svn-id: https://svn.code.sf.net/p/synalist/code/trunk@243 7c85be65-684b-0410-a082-b2ed4fbef004
This commit is contained in:
parent
009ef79a18
commit
fc2aeacaf6
27
sslinux.inc
27
sslinux.inc
@ -64,7 +64,13 @@ interface
|
||||
uses
|
||||
SyncObjs, SysUtils, Classes,
|
||||
synafpc,
|
||||
Libc;
|
||||
{$IFDEF POSIX} //even POSIX should use new ssPosix module instead...
|
||||
Posix.Errno,
|
||||
Posix.Signal,
|
||||
Posix.NetDB
|
||||
{$ELSE}
|
||||
Libc
|
||||
{$ENDIF};
|
||||
|
||||
function InitSocketInterface(stack: string): Boolean;
|
||||
function DestroySocketInterface: Boolean;
|
||||
@ -79,6 +85,9 @@ type
|
||||
u_long = Longint;
|
||||
pu_long = ^u_long;
|
||||
pu_short = ^u_short;
|
||||
{$IFDEF POSIX}
|
||||
uint32_t = UInt32;
|
||||
{$ENDIF}
|
||||
TSocket = u_int;
|
||||
TAddrFamily = integer;
|
||||
|
||||
@ -148,9 +157,9 @@ type
|
||||
0: (sin_family: u_short;
|
||||
sin_port: u_short;
|
||||
sin_addr: TInAddr;
|
||||
sin_zero: array[0..7] of Char);
|
||||
sin_zero: array[0..7] of byte);
|
||||
1: (sa_family: u_short;
|
||||
sa_data: array[0..13] of Char)
|
||||
sa_data: array[0..13] of byte)
|
||||
end;
|
||||
|
||||
TIP_mreq = record
|
||||
@ -602,7 +611,7 @@ type
|
||||
case sin_family: u_short of
|
||||
AF_INET: (sin_port: u_short;
|
||||
sin_addr: TInAddr;
|
||||
sin_zero: array[0..7] of Char);
|
||||
sin_zero: array[0..7] of byte);
|
||||
AF_INET6: (sin6_port: u_short;
|
||||
sin6_flowinfo: u_long;
|
||||
sin6_addr: TInAddr6;
|
||||
@ -759,9 +768,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;
|
||||
@ -1214,7 +1223,11 @@ begin
|
||||
begin
|
||||
SockEnhancedApi := False;
|
||||
SockWship6Api := False;
|
||||
Libc.Signal(Libc.SIGPIPE, TSignalHandler(Libc.SIG_IGN));
|
||||
{$IfDef POSIX}
|
||||
Signal(SIGPIPE, TSignalHandler(SIG_IGN));
|
||||
{$Else}
|
||||
Libc.Signal(Libc.SIGPIPE, TSignalHandler(Libc.SIG_IGN));
|
||||
{$EndIf}
|
||||
LibHandle := LoadLibrary(PChar(Stack));
|
||||
if LibHandle <> 0 then
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user