-
Notifications
You must be signed in to change notification settings - Fork 1
/
sockftpd.pas
64 lines (41 loc) · 1.17 KB
/
sockftpd.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
program sockftpd;
uses {$ifdef unix}cthreads, cmem, {$endif}
Logger,
Classes,
IdBaseComponent,
IdCustomTCPServer,
IdContext,
SysUtils,
custApp,
IdGlobal,
SockFTPDDaemon,
SockFTPDManager;
var D: TSockFTPDDaemon;
begin
if not ISockFTPDManagerLoaded then
begin
Console.error( 'SockFTPD will now quit' );
Halt( 78 ); // configuration error
end else
begin
try
D := TSockFTPDDaemon.Create(
ISockFTPDManager.ServerListenInterface,
ISockFTPDManager.ServerPort,
ISockFTPDManager.ServerProtocolName,
ISockFTPDManager.AllowedOriginsList
);
try
D.Run;
finally
D.Free;
end;
except
On E: Exception Do
Begin
Console.Error( 'Internal software error: ' + E.Message );
Halt( 70 ); // Internal software error
End;
End;
end;
end.