mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 21:09:24 +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
|
||||
Classes, lNet, lTelnet;
|
||||
|
||||
const
|
||||
DEFAULT_FTP_PORT = 1025;
|
||||
|
||||
type
|
||||
TLFTP = class;
|
||||
TLFTPClient = class;
|
||||
@ -88,7 +91,7 @@ type
|
||||
property SocketClass: TLSocketClass read GetSocketClass write SetSocketClass;
|
||||
property ControlConnection: TLTelnetClient read FControl;
|
||||
property DataConnection: TLTCP read FData;
|
||||
property TransferMethod: TLFTPTransferMethod read FTransferMethod write FTransferMethod;
|
||||
property TransferMethod: TLFTPTransferMethod read FTransferMethod write FTransferMethod default ftPassive;
|
||||
end;
|
||||
|
||||
{ TLFTPTelnetClient }
|
||||
@ -203,7 +206,7 @@ type
|
||||
property Binary: Boolean read GetBinary write SetBinary;
|
||||
property PipeLine: Boolean read FPipeLine write FPipeLine;
|
||||
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 OnError: TLSocketErrorEvent read FOnError write FOnError;
|
||||
@ -224,7 +227,6 @@ uses
|
||||
|
||||
const
|
||||
FLE = #13#10;
|
||||
DEFAULT_PORT = 1024;
|
||||
|
||||
EMPTY_REC: TLFTPStatusRec = (Status: fsNone; Args: ('', ''));
|
||||
|
||||
@ -352,7 +354,7 @@ begin
|
||||
FStatusSet := []; // empty Event set
|
||||
FPassWord := '';
|
||||
FChunkSize := DEFAULT_CHUNK;
|
||||
FStartPort := DEFAULT_PORT;
|
||||
FStartPort := DEFAULT_FTP_PORT;
|
||||
FSL := TStringList.Create;
|
||||
FLastPort := FStartPort;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ lNet v0.5.2
|
||||
{ lNet v0.5.3
|
||||
|
||||
CopyRight (C) 2004-2006 Ales Katona
|
||||
|
||||
@ -465,9 +465,10 @@ var
|
||||
a: TSockAddr;
|
||||
l: Integer;
|
||||
begin
|
||||
Result := '';
|
||||
l := SizeOf(a);
|
||||
fpGetSockName(FHandle, @a, @l);
|
||||
Result := HostAddrToStr(LongWord(a.sin_addr));
|
||||
if fpGetSockName(FHandle, @a, @l) = 0 then
|
||||
Result := NetAddrToStr(LongWord(a.sin_addr));
|
||||
end;
|
||||
|
||||
function TLSocket.CanSend: Boolean;
|
||||
@ -562,7 +563,7 @@ end;
|
||||
|
||||
function TLSocket.GetLocalPort: Word;
|
||||
begin
|
||||
Result := FAddress.sin_port;
|
||||
Result := ntohs(FAddress.sin_port);
|
||||
end;
|
||||
|
||||
function TLSocket.GetPeerPort: Word;
|
||||
@ -1056,6 +1057,7 @@ begin
|
||||
if FRootSock.Listen(APort, AIntf) then begin
|
||||
FRootSock.FConnected := True;
|
||||
FRootSock.FServerSocket := True;
|
||||
FIterator := FRootSock;
|
||||
RegisterWithEventer;
|
||||
Result := true;
|
||||
end;
|
||||
@ -1161,8 +1163,9 @@ begin
|
||||
end;
|
||||
FRootSock.FNextSock := Tmp;
|
||||
Tmp.FPrevSock := FRootSock;
|
||||
if not Assigned(FIterator) then
|
||||
FIterator := Tmp;
|
||||
if not Assigned(FIterator) // if we don't have (bug?) an iterator yet
|
||||
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);
|
||||
FEventer.AddHandle(Tmp);
|
||||
AcceptEvent(Tmp);
|
||||
|
Loading…
Reference in New Issue
Block a user