commit - 7c7d7bb779eb716b43704a3e5c77590e2b823edd
commit + 15354eed0814392f42d04f3b6aeb71df253b1d66
blob - af43095fcb1ef93bf6db6aa1eda811e2a14ef1ef
blob + 437e23e1a780902fc071dc50f6ebe40869eab779
--- gemini.c
+++ gemini.c
static void close_with_err(struct req*, const char *err);
static struct req *req_by_id(uint32_t);
+static struct req *req_by_id_try(uint32_t);
static void do_handshake(int, short, void*);
static void write_request(int, short, void*);
static struct req *
req_by_id(uint32_t id)
+{
+ struct req *r;
+
+ if ((r = req_by_id_try(id)) == NULL)
+ die();
+ return r;
+}
+
+static struct req *
+req_by_id_try(uint32_t id)
{
struct req *r;
return r;
}
- die();
+ return NULL;
}
static void
{
struct req *req;
- req = req_by_id(imsg->hdr.peerid);
+ if ((req = req_by_id_try(imsg->hdr.peerid)) == NULL)
+ return;
close_conn(0, 0, req);
}