From 31f366e1b207b59df67d26d69ef31dcfe9b57c19 Mon Sep 17 00:00:00 2001 From: Ken Johnson Date: Fri, 17 Apr 2026 14:00:09 -0700 Subject: [PATCH] v0.5.2: bump version (coordinated cross-repo release) + Win64 fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fw_consts.pas is hardlinked across Server/Client/Doors/Common; all three binaries now report v0.5.2 from a single source. Bundles the prior cross-repo cleanup commit (Server-canonical shared units, mysql/ postgres Makefile paths, fw_filewatcher + fw_schema added). Win64 cross-compile fix bundled in (re-issued v0.5.2 — original v0.5.2 build failed at fm_net_socket.pas because IsPortInUse and TFMSocket.WaitForData declared Unix-specific local vars (cint / TFDSet / TTimeVal) outside the {\$IFDEF UNIX} guard. Wrapped each function's var section AND body in {\$IFDEF UNIX} with a plain Windows stub. Linux + FreeBSD + Win64 verified locally. Client functional behavior unchanged on Linux/FreeBSD — thin client still talks to primary server via REST/WS. --- src/units/fm_net_socket.pas | 19 +++++++++++++++---- src/units/fw_consts.pas | 4 ++-- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/units/fm_net_socket.pas b/src/units/fm_net_socket.pas index 88377f6..82b4508 100644 --- a/src/units/fm_net_socket.pas +++ b/src/units/fm_net_socket.pas @@ -92,6 +92,7 @@ const {$ENDIF} function IsPortInUse(APort: Word): Boolean; +{$IFDEF UNIX} var Sock: cint; Addr: TSockAddr; @@ -112,6 +113,13 @@ begin fpClose(Sock); end; end; +{$ELSE} +begin + { Best-effort: on non-Unix platforms we don't pre-check; the listener + will fail fast on bind() if the port is genuinely in use. } + Result := False; +end; +{$ENDIF} { TFMSocket } @@ -291,6 +299,7 @@ begin end; function TFMSocket.WaitForData(ATimeoutMS: Integer): Boolean; +{$IFDEF UNIX} var FDS: TFDSet; TimeVal: TTimeVal; @@ -300,7 +309,6 @@ begin Result := False; if not FConnected then Exit; - {$IFDEF UNIX} if Assigned(FSocket) then Fd := FSocket.Handle else if Assigned(FStream) and (FStream is THandleStream) then @@ -314,10 +322,13 @@ begin TimeVal.tv_usec := (ATimeoutMS mod 1000) * 1000; Ret := fpSelect(Fd + 1, @FDS, nil, nil, @TimeVal); Result := Ret > 0; - {$ELSE} - Result := True; - {$ENDIF} end; +{$ELSE} +begin + { Non-Unix: assume data is available; caller will handle EAGAIN. } + Result := FConnected; +end; +{$ENDIF} { TFMListener } diff --git a/src/units/fw_consts.pas b/src/units/fw_consts.pas index b2665b7..4b4670f 100644 --- a/src/units/fw_consts.pas +++ b/src/units/fw_consts.pas @@ -7,8 +7,8 @@ interface const FW_VERSION_MAJOR = 0; FW_VERSION_MINOR = 5; - FW_VERSION_PATCH = 0; - FW_VERSION_STRING = '0.5.0'; + FW_VERSION_PATCH = 2; + FW_VERSION_STRING = '0.5.2'; FW_PRODUCT_NAME = 'Fastway BBS'; FW_PRODUCT_CODE = 'FWBBS'; FW_SERVER_BANNER = FW_PRODUCT_NAME + ' v' + FW_VERSION_STRING;