diff options
author | bptato <nincsnevem662@gmail.com> | 2024-07-19 18:12:44 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-07-19 18:16:12 +0200 |
commit | 0d08ee8959d126d652fc42e9af63dbc8cc1d93ba (patch) | |
tree | 1b597924989f1eb3e4b96714c69e385af97d7186 /src/loader/response.nim | |
parent | f94b84bde340739647ffe7dd92cfcefb6686eca2 (diff) | |
download | chawan-0d08ee8959d126d652fc42e9af63dbc8cc1d93ba.tar.gz |
loader: async status/headers for fetch
The status code & headers are no longer guaranteed to be sent right after res/outputId, so read them asynchronously instead. (This is pretty much the same code as the buffer connection handler in pager. Hopefully we can merge the two at some point.)
Diffstat (limited to 'src/loader/response.nim')
-rw-r--r-- | src/loader/response.nim | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/loader/response.nim b/src/loader/response.nim index 8b33621e..5531da9d 100644 --- a/src/loader/response.nim +++ b/src/loader/response.nim @@ -59,13 +59,15 @@ type jsDestructor(Response) -proc newResponse*(res: int; request: Request; stream: SocketStream): Response = +proc newResponse*(res: int; request: Request; stream: SocketStream; + outputId: int; status: uint16): Response = return Response( res: res, url: request.url, body: stream, bodyRead: EmptyPromise(), - outputId: -1 + outputId: outputId, + status: status ) func makeNetworkError*(): Response {.jsstfunc: "Response.error".} = |