mirror of
https://github.com/rejetto/hfs2.git
synced 2025-12-19 10:03:56 +01:00
fix: display ipv6 address with brackets in log
This commit is contained in:
parent
74a5710f99
commit
bdc5991fa1
@ -156,6 +156,7 @@ type
|
||||
P_requestCount: integer;
|
||||
P_destroying: boolean; // destroying is in progress
|
||||
P_sndBuf: integer;
|
||||
P_v6: boolean;
|
||||
persistent: boolean;
|
||||
disconnecting: boolean; // disconnected() has been called
|
||||
lockCount: integer; // prevent freeing of the object
|
||||
@ -219,6 +220,7 @@ type
|
||||
function initInputStream():boolean;
|
||||
property address:string read P_address; // other peer ip address
|
||||
property port:string read P_port; // other peer port
|
||||
property v6:boolean read P_v6;
|
||||
property requestCount:integer read P_requestCount;
|
||||
property bytesToSend:int64 read getBytesToSend;
|
||||
property bytesToPost:int64 read getBytesToPost;
|
||||
@ -978,6 +980,7 @@ limiters:=TObjectList.create;
|
||||
limiters.ownsObjects:=FALSE;
|
||||
P_address:=sock.GetPeerAddr();
|
||||
P_port:=sock.GetPeerPort();
|
||||
P_v6:=pos(':', address) > 0;
|
||||
state:=HCS_IDLE;
|
||||
srv:=server;
|
||||
srv.conns.add(self);
|
||||
|
||||
10
main.pas
10
main.pas
@ -4179,11 +4179,13 @@ if lines = '' then
|
||||
else
|
||||
rest:=reReplace(lines, '^', '> ')+CRLF;
|
||||
|
||||
addr:='';
|
||||
if assigned(cd) and assigned(cd.conn) then
|
||||
addr:=nonEmptyConcat('', cd.user, '@')
|
||||
+cd.address+':'+cd.conn.port
|
||||
+nonEmptyConcat(' {', localDNSget(cd.address), '}');
|
||||
+ifThen(cd.conn.v6, '['+cd.address+']', cd.address)
|
||||
+':'+cd.conn.port
|
||||
+nonEmptyConcat(' {', localDNSget(cd.address), '}')
|
||||
else
|
||||
addr:='';
|
||||
|
||||
if (logFile.filename > '') and (logFile.apacheFormat = '') then
|
||||
begin
|
||||
@ -11371,7 +11373,7 @@ pt:=logbox.caretpos;
|
||||
if pt.y >= logbox.lines.count then
|
||||
exit;
|
||||
s:=logbox.lines[pt.y];
|
||||
s:=reGet(s, '^.+ (\S+@)?(\S+):\d+ ', 2);
|
||||
s:=reGet(s, '^.+ (\S+@)?\[?(\S+?)\]?:\d+ ', 2);
|
||||
if checkAddressSyntax(s,FALSE) then
|
||||
result:=s;
|
||||
end; // ipPointedInLog
|
||||
|
||||
Loading…
Reference in New Issue
Block a user