diff options
author | bptato <nincsnevem662@gmail.com> | 2023-04-30 12:19:24 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-04-30 12:19:24 +0200 |
commit | a02c408f933aea6f405ed3c64ab151b01b33ae9e (patch) | |
tree | 4946f6b13da782a92a1ecc0f03402abacf2614b3 /src/buffer | |
parent | 05b64a1d8fa95381d756231f665c0b8c79787b67 (diff) | |
download | chawan-a02c408f933aea6f405ed3c64ab151b01b33ae9e.tar.gz |
WIP fetch
Diffstat (limited to 'src/buffer')
-rw-r--r-- | src/buffer/buffer.nim | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/buffer/buffer.nim b/src/buffer/buffer.nim index 5aec73df..85034d9e 100644 --- a/src/buffer/buffer.nim +++ b/src/buffer/buffer.nim @@ -1146,6 +1146,15 @@ proc runBuffer(buffer: Buffer, rfd: int) = buffer.onload() else: assert false + elif event.fd in buffer.loader.connecting: + if Event.Read in event.events: + buffer.loader.onConnected(event.fd) + else: + # probably shouldn't happen. TODO: maybe with Error? + assert false + elif event.fd in buffer.loader.ongoing: + #TODO something with readablestream? + discard elif event.fd in buffer.timeouts: if Event.Timer in event.events: buffer.selector.unregister(event.fd) @@ -1180,6 +1189,7 @@ proc launchBuffer*(config: BufferConfig, source: BufferSource, ) buffer.readbufsize = BufferSize buffer.selector = newSelector[int]() + loader.registerFun = proc(fd: int) = buffer.selector.registerHandle(fd, {Read}, 0) buffer.srenderer = newStreamRenderer(buffer.sstream) if buffer.config.scripting: buffer.window = newWindow(buffer.config.scripting, some(buffer.loader)) |