diff options
author | bptato <nincsnevem662@gmail.com> | 2023-06-06 23:24:20 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-06-06 23:24:20 +0200 |
commit | c15d04041b1b8660000a1517b9d4bfc06f2cb490 (patch) | |
tree | 1b51ae72f9589be303f4ed6318cac35309f4dcb2 /src/display/client.nim | |
parent | f94439ca8d5025252e9207cf831ec1e5d0e9a674 (diff) | |
download | chawan-c15d04041b1b8660000a1517b9d4bfc06f2cb490.tar.gz |
Fix bug in client's unregistered fd handling
+ run JS jobs after every poll in headless mode
Diffstat (limited to 'src/display/client.nim')
-rw-r--r-- | src/display/client.nim | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/display/client.nim b/src/display/client.nim index 95f036f8..456ca502 100644 --- a/src/display/client.nim +++ b/src/display/client.nim @@ -317,6 +317,8 @@ proc handleError(client: Client, fd: int) = elif fd in client.loader.ongoing: #TODO something with readablestream? discard + elif fd in client.loader.unregistered: + discard # already unregistered... else: if fd in client.fdmap: let container = client.fdmap[fd] @@ -329,7 +331,7 @@ proc handleError(client: Client, fd: int) = if client.console.container != nil: client.console.show() else: - quit(1) + doAssert false proc inputLoop(client: Client) = let selector = client.selector @@ -352,6 +354,7 @@ proc inputLoop(client: Client) = client.runJSJobs() client.console.container.requestLines().then(proc() = client.console.container.cursorLastLine()) + client.loader.unregistered.setLen(0) if client.pager.scommand != "": client.command(client.pager.scommand) client.pager.scommand = "" @@ -379,7 +382,8 @@ proc headlessLoop(client: Client) = client.handleError(event.fd) if Event.Timer in event.events: assert client.timeouts.runTimeoutFd(event.fd) - client.runJSJobs() + client.runJSJobs() + client.loader.unregistered.setLen(0) client.acceptBuffers() proc clientLoadJSModule(ctx: JSContext, module_name: cstring, |