commit 71a2feab64c718e24fd610ee8c95a57f6da13b8c from: Omar Polo date: Wed Mar 10 22:02:53 2021 UTC early add requests to the queue close_with_err does a close_conn which in turns drops req from the queue. Thus it crashes on error, avoid that. commit - 040fbdf88d5ac6d6cd89e5de3b3473c60d4f230f commit + 71a2feab64c718e24fd610ee8c95a57f6da13b8c blob - a1c257215f7f6c1e9d123d4250f34403415a94e1 blob + af43095fcb1ef93bf6db6aa1eda811e2a14ef1ef --- gemini.c +++ gemini.c @@ -407,6 +407,7 @@ handle_get(struct imsg *imsg, size_t datalen) die(); req->id = imsg->hdr.peerid; + TAILQ_INSERT_HEAD(&reqhead, req, reqs); if (!url_parse(imsg->data, &req->url, &e)) { fprintf(stderr, "failed to parse url: %s\n", e); @@ -427,7 +428,6 @@ handle_get(struct imsg *imsg, size_t datalen) goto err; } - TAILQ_INSERT_HEAD(&reqhead, req, reqs); yield_w(req, do_handshake, &timeout_for_handshake); return;