Commit Diff
- Commit:
1deaf3979efdb3e27a57aeb2d7c93c0b7550639d
- From:
- Omar Polo <op@omarpolo.com>
- Date:
- Message:
- set the off to zero after flushing the buffer this was the cause we had duplicated "chunks" in the pages: if we enter copy_body with req->off != 0 but then tls_read returns WANT_POLLIN/POLLOUT, the next time we flush the same chunk again.
- Actions:
- Patch | Tree
--- gemini.c +++ gemini.c @@ -384,6 +384,7 @@ copy_body(int fd, short ev, void *d) imsg_compose(ibuf, IMSG_BUF, req->id, 0, -1, req->buf, req->off); imsg_flush(ibuf); + req->off = 0; } switch (r = tls_read(req->ctx, req->buf, sizeof(req->buf))) {