commit 1deaf3979efdb3e27a57aeb2d7c93c0b7550639d from: Omar Polo date: Sun Mar 14 18:10:27 2021 UTC 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. commit - e430495420ca83b7c02175962e6e7fc38f028856 commit + 1deaf3979efdb3e27a57aeb2d7c93c0b7550639d blob - c8a306c49553d05da19cacfd56928eda7bde96a2 blob + 479ee40078ca0f36bcd7a281d92b868e0d298a95 --- 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))) {