diff options
author | bptato <nincsnevem662@gmail.com> | 2024-02-29 23:23:40 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-02-29 23:31:38 +0100 |
commit | afafcaf1047f721c8d061d883329d0e556326511 (patch) | |
tree | 2abc62a06227c7aa9c573f9ce52424df638ccba8 /src/local/pager.nim | |
parent | f4b53af1261e6f9be16a315247ace80fcb816505 (diff) | |
download | chawan-afafcaf1047f721c8d061d883329d0e556326511.tar.gz |
buffer, client: fix deadlock with send() calls
This is an ancient bug, but it got much easier to trigger with mouse scrolling support so it's time to fix it. (The bug itself was that since both the client and buffer ends of the controlling stream are blocking, they could get stuck when both were trying to send() data to the other end but the buffer was full. So now we set the client end to non-blocking.)
Diffstat (limited to 'src/local/pager.nim')
-rw-r--r-- | src/local/pager.nim | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/local/pager.nim b/src/local/pager.nim index 1040c259..d8f7c5dd 100644 --- a/src/local/pager.nim +++ b/src/local/pager.nim @@ -21,8 +21,8 @@ import extern/editor import extern/runproc import extern/stdio import extern/tempfile +import io/posixstream import io/promise -import io/socketstream import js/error import js/javascript import js/jstypes @@ -86,7 +86,7 @@ type statusgrid*: FixedGrid term*: Terminal tmpdir: string - unreg*: seq[(Pid, SocketStream)] + unreg*: seq[(Pid, PosixStream)] urimethodmap: URIMethodMap username: string @@ -583,7 +583,7 @@ proc deleteContainer(pager: Pager, container: Container) = pager.setContainer(nil) container.parent = nil container.children.setLen(0) - pager.unreg.add((container.process, SocketStream(container.iface.stream))) + pager.unreg.add((container.process, container.iface.stream)) pager.forkserver.removeChild(container.process) proc discardBuffer(pager: Pager, container = none(Container)) {.jsfunc.} = |