From 9bfec9beaaffc6f850f3ae04764ed13c004f45fe Mon Sep 17 00:00:00 2001 From: Massimo Melina Date: Fri, 22 May 2020 12:14:24 +0200 Subject: [PATCH] initial ipv6 support --- developer notes.txt | 3 ++- hslib.pas | 24 +++++++++++++++++------- main.dfm | 1 - todo.txt | 1 + 4 files changed, 20 insertions(+), 9 deletions(-) diff --git a/developer notes.txt b/developer notes.txt index 29151db..82cbdf9 100644 --- a/developer notes.txt +++ b/developer notes.txt @@ -3,5 +3,6 @@ Initially developed with Delphi 6, now with Delphi 10.3.3 Icons are generated at http://fontello.com/ . Use fontello.json for further modifications. === LIBS USED -ICS v8.58 by François PIETTE http://www.overbyte.be +ICS v8.63 by François PIETTE http://www.overbyte.be TRegExpr v0.952 by Andrey V. Sorokin http://www.regexpstudio.com/TRegExpr/TRegExpr.html +JEDI Code Library v2.7 https://github.com/project-jedi/jcl \ No newline at end of file diff --git a/hslib.pas b/hslib.pas index 473b587..3e9651d 100644 --- a/hslib.pas +++ b/hslib.pas @@ -29,7 +29,7 @@ unit HSlib; interface uses - OverbyteIcsWSocket, classes, messages, winprocs, forms, extctrls, sysutils, system.contnrs, strUtils, winsock, inifiles, types; + OverbyteIcsWSocket, OverbyteIcsWSockets, classes, messages, winprocs, forms, extctrls, sysutils, system.contnrs, strUtils, winsock, inifiles, types; const VERSION = '2.11.0'; @@ -261,7 +261,7 @@ type procedure calculateSpeed(); procedure processDisconnecting(); public - sock: Twsocket; // listening socket + sock: TwsocketServer; // listening socket conns, // full list of connected clients disconnecting, // list of pending disconnections offlines, // disconnected clients to be freed @@ -661,15 +661,25 @@ begin result:=FALSE; if active or not assigned(sock) then exit; try - if onAddress = '' then onAddress:='*'; - if (onAddress = '') or (onAddress = '*') then sock.addr:='0.0.0.0' - else sock.addr:=onAddress; + if onAddress = '' then + onAddress:='*'; + sock.addr:=ifThen(onAddress = '*', '0.0.0.0', onAddress); sock.port:=port; - sock.proto:='6'; sock.listen(); if port = '0' then P_port:=sock.getxport(); result:=TRUE; + + try + sock.MultiListenSockets.Clear(); + with sock.MultiListenSockets.Add do + begin + addr := '::'; + Port := sock.port + end; + sock.MultiListen(); + except end; + notify(HE_OPEN, NIL); except end; @@ -689,7 +699,7 @@ begin notify(HE_CLOSE, NIL) end; constructor ThttpSrv.create(); begin -sock:=TWSocket.create(NIL); +sock:=TWSocketServer.create(NIL); sock.OnSessionAvailable:=connected; sock.OnSessionClosed:=disconnected; sock.OnBgException:=bgexception; diff --git a/main.dfm b/main.dfm index d37fb43..c6f4805 100644 --- a/main.dfm +++ b/main.dfm @@ -2935,7 +2935,6 @@ object mainFrm: TmainFrm object pwdInPagesChk: TMenuItem AutoCheck = True Caption = 'Include password in pages (for download managers)' - OnClick = pwdInPagesChkClick end object httpsUrlsChk: TMenuItem AutoCheck = True diff --git a/todo.txt b/todo.txt index 251004f..4ca1060 100644 --- a/todo.txt +++ b/todo.txt @@ -1,3 +1,4 @@ ++ replace shellExtDlg.gif with transparent png (english system) + expiring links * dismiss regexp lib http://docwiki.embarcadero.com/Libraries/Rio/en/System.RegularExpressions.TRegEx + ipv6