Commita3f76b68Recorded3 Sep 2026Repositorysigil-irc

Add IRC WebSocket setup timeouts

Changed
 CHANGELOG.md                                             |  8 +++++++-
 package.sgl                                              |  2 +-
 packages/sigil-irc-websocket/src/sigil/irc/websocket.sgl | 26 ++++++++++++++++++++++----
 3 files changed, 30 insertions(+), 6 deletions(-)
Diff
CHANGELOG.mdmodified
@@ -7,6 +7,13 @@ All notable changes to this project will be documented in this file.
7
The format is based on [Keep a Changelog](https://keepachangelog.com/),
8
and this project adheres to [Semantic Versioning](https://semver.org/).
9
+10
## [0.16.5] - 2026-09-03
+11
+12
### Added
+13
+14
- IRC-over-WebSocket sessions can carry native connect, TLS-handshake, and
+15
HTTP-upgrade timeout settings through to `ws-connect`.
+16
17
## [0.10.1] - 2026-04-29
18
19
### Fixed
@@ -113,4 +120,3 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
120
- Git repository operations including status, staging, commits, branches, and diff inspection.
121
- JSON parsing and serialization with bidirectional mapping between JSON and native Scheme types (dicts, arrays, strings, numbers, booleans). Port-based I/O for reading and writing JSON streams.
122
- IRC client for connecting to IRC networks with message handling and channel operations.
−116
package.sglmodified
@@ -6,7 +6,7 @@
6
7
(workspace
8
name: "sigil-irc"
−9
version: "0.16.4"
+9
version: "0.16.5"
10
description: "IRC protocol libraries for Sigil"
11
url: "https://codeberg.org/sigil/sigil-irc"
12
license: "BSD-3-Clause"
packages/sigil-irc-websocket/src/sigil/irc/websocket.sglmodified
@@ -22,6 +22,9 @@
22
irc-ws-session-nick
23
irc-ws-session-user
24
irc-ws-session-realname
+25
irc-ws-session-connect-timeout-ms
+26
irc-ws-session-handshake-timeout-ms
+27
irc-ws-session-upgrade-timeout-ms
28
irc-ws-session-websocket
29
irc-ws-session-state
30
irc-ws-session-server-caps
@@ -61,6 +64,9 @@
64
(nick default: #f)
65
(user default: #f)
66
(realname default: "")
+67
(connect-timeout-ms default: #f)
+68
(handshake-timeout-ms default: #f)
+69
(upgrade-timeout-ms default: #f)
70
(websocket default: #f mutable: #t)
71
(state default: 'disconnected mutable: #t)
72
(buffer default: "" mutable: #t)
@@ -72,15 +78,23 @@
78
(define (make-irc-ws-session (keys: (url #f)
79
(nick #f)
80
(user #f)
−75
(realname "")))
−76
(: (url: any?) (nick: any?) (user: any?) (realname: string?) -> irc-ws-session?)
+81
(realname "")
+82
(connect-timeout-ms #f)
+83
(handshake-timeout-ms #f)
+84
(upgrade-timeout-ms #f)))
+85
(: (url: any?) (nick: any?) (user: any?) (realname: string?)
+86
(connect-timeout-ms: any?) (handshake-timeout-ms: any?)
+87
(upgrade-timeout-ms: any?) -> irc-ws-session?)
88
(unless url
89
(error "make-irc-ws-session: url: is required"))
90
(irc-ws-session
91
url: url
92
nick: nick
93
user: (or user nick)
−83
realname: (if (and nick (string=? realname "")) nick realname)))
+94
realname: (if (and nick (string=? realname "")) nick realname)
+95
connect-timeout-ms: connect-timeout-ms
+96
handshake-timeout-ms: handshake-timeout-ms
+97
upgrade-timeout-ms: upgrade-timeout-ms))
98
99
(define (strip-line-ending line)
100
(let ((len (string-length line)))
@@ -495,7 +509,11 @@
509
(when (not (eq? (irc-ws-session-state session) 'disconnected))
510
(error "irc-ws-connect: already connected or connecting"))
511
(set-irc-ws-session-state! session 'connecting)
−498
(let ((websocket (ws-connect (irc-ws-session-url session))))
+512
(let ((websocket
+513
(ws-connect (irc-ws-session-url session)
+514
connect-timeout-ms: (irc-ws-session-connect-timeout-ms session)
+515
handshake-timeout-ms: (irc-ws-session-handshake-timeout-ms session)
+516
upgrade-timeout-ms: (irc-ws-session-upgrade-timeout-ms session))))
517
(if (not websocket)
518
(begin
519
(set-irc-ws-session-state! session 'disconnected)