mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-30 18:00:43 +02:00
* update lnet to 0.5.3
git-svn-id: trunk@7860 -
This commit is contained in:
parent
9b50dc572b
commit
3b23378ab2
@ -31,6 +31,9 @@ interface
|
|||||||
uses
|
uses
|
||||||
Classes, lNet, lTelnet;
|
Classes, lNet, lTelnet;
|
||||||
|
|
||||||
|
const
|
||||||
|
DEFAULT_FTP_PORT = 1025;
|
||||||
|
|
||||||
type
|
type
|
||||||
TLFTP = class;
|
TLFTP = class;
|
||||||
TLFTPClient = class;
|
TLFTPClient = class;
|
||||||
@ -88,7 +91,7 @@ type
|
|||||||
property SocketClass: TLSocketClass read GetSocketClass write SetSocketClass;
|
property SocketClass: TLSocketClass read GetSocketClass write SetSocketClass;
|
||||||
property ControlConnection: TLTelnetClient read FControl;
|
property ControlConnection: TLTelnetClient read FControl;
|
||||||
property DataConnection: TLTCP read FData;
|
property DataConnection: TLTCP read FData;
|
||||||
property TransferMethod: TLFTPTransferMethod read FTransferMethod write FTransferMethod;
|
property TransferMethod: TLFTPTransferMethod read FTransferMethod write FTransferMethod default ftPassive;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{ TLFTPTelnetClient }
|
{ TLFTPTelnetClient }
|
||||||
@ -203,7 +206,7 @@ type
|
|||||||
property Binary: Boolean read GetBinary write SetBinary;
|
property Binary: Boolean read GetBinary write SetBinary;
|
||||||
property PipeLine: Boolean read FPipeLine write FPipeLine;
|
property PipeLine: Boolean read FPipeLine write FPipeLine;
|
||||||
property Echo: Boolean read GetEcho write SetEcho;
|
property Echo: Boolean read GetEcho write SetEcho;
|
||||||
property StartPort: Word read FStartPort write FStartPort;
|
property StartPort: Word read FStartPort write FStartPort default DEFAULT_FTP_PORT;
|
||||||
property Transfer: Boolean read GetTransfer;
|
property Transfer: Boolean read GetTransfer;
|
||||||
|
|
||||||
property OnError: TLSocketErrorEvent read FOnError write FOnError;
|
property OnError: TLSocketErrorEvent read FOnError write FOnError;
|
||||||
@ -224,7 +227,6 @@ uses
|
|||||||
|
|
||||||
const
|
const
|
||||||
FLE = #13#10;
|
FLE = #13#10;
|
||||||
DEFAULT_PORT = 1024;
|
|
||||||
|
|
||||||
EMPTY_REC: TLFTPStatusRec = (Status: fsNone; Args: ('', ''));
|
EMPTY_REC: TLFTPStatusRec = (Status: fsNone; Args: ('', ''));
|
||||||
|
|
||||||
@ -352,7 +354,7 @@ begin
|
|||||||
FStatusSet := []; // empty Event set
|
FStatusSet := []; // empty Event set
|
||||||
FPassWord := '';
|
FPassWord := '';
|
||||||
FChunkSize := DEFAULT_CHUNK;
|
FChunkSize := DEFAULT_CHUNK;
|
||||||
FStartPort := DEFAULT_PORT;
|
FStartPort := DEFAULT_FTP_PORT;
|
||||||
FSL := TStringList.Create;
|
FSL := TStringList.Create;
|
||||||
FLastPort := FStartPort;
|
FLastPort := FStartPort;
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ lNet v0.5.2
|
{ lNet v0.5.3
|
||||||
|
|
||||||
CopyRight (C) 2004-2006 Ales Katona
|
CopyRight (C) 2004-2006 Ales Katona
|
||||||
|
|
||||||
@ -465,9 +465,10 @@ var
|
|||||||
a: TSockAddr;
|
a: TSockAddr;
|
||||||
l: Integer;
|
l: Integer;
|
||||||
begin
|
begin
|
||||||
|
Result := '';
|
||||||
l := SizeOf(a);
|
l := SizeOf(a);
|
||||||
fpGetSockName(FHandle, @a, @l);
|
if fpGetSockName(FHandle, @a, @l) = 0 then
|
||||||
Result := HostAddrToStr(LongWord(a.sin_addr));
|
Result := NetAddrToStr(LongWord(a.sin_addr));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLSocket.CanSend: Boolean;
|
function TLSocket.CanSend: Boolean;
|
||||||
@ -562,7 +563,7 @@ end;
|
|||||||
|
|
||||||
function TLSocket.GetLocalPort: Word;
|
function TLSocket.GetLocalPort: Word;
|
||||||
begin
|
begin
|
||||||
Result := FAddress.sin_port;
|
Result := ntohs(FAddress.sin_port);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TLSocket.GetPeerPort: Word;
|
function TLSocket.GetPeerPort: Word;
|
||||||
@ -1056,6 +1057,7 @@ begin
|
|||||||
if FRootSock.Listen(APort, AIntf) then begin
|
if FRootSock.Listen(APort, AIntf) then begin
|
||||||
FRootSock.FConnected := True;
|
FRootSock.FConnected := True;
|
||||||
FRootSock.FServerSocket := True;
|
FRootSock.FServerSocket := True;
|
||||||
|
FIterator := FRootSock;
|
||||||
RegisterWithEventer;
|
RegisterWithEventer;
|
||||||
Result := true;
|
Result := true;
|
||||||
end;
|
end;
|
||||||
@ -1161,8 +1163,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
FRootSock.FNextSock := Tmp;
|
FRootSock.FNextSock := Tmp;
|
||||||
Tmp.FPrevSock := FRootSock;
|
Tmp.FPrevSock := FRootSock;
|
||||||
if not Assigned(FIterator) then
|
if not Assigned(FIterator) // if we don't have (bug?) an iterator yet
|
||||||
FIterator := Tmp;
|
or FIterator.FServerSocket then // or if it's the first socket accepted
|
||||||
|
FIterator := Tmp; // assign it as iterator (don't assign later acceptees)
|
||||||
Inc(FCount);
|
Inc(FCount);
|
||||||
FEventer.AddHandle(Tmp);
|
FEventer.AddHandle(Tmp);
|
||||||
AcceptEvent(Tmp);
|
AcceptEvent(Tmp);
|
||||||
|
Loading…
Reference in New Issue
Block a user