diff --git a/lib/hio.c b/lib/hio.c index 0e1ea17..bbf89b2 100644 --- a/lib/hio.c +++ b/lib/hio.c @@ -173,6 +173,15 @@ void hio_fini (hio_t* hio) } } + /* clean up unfired cwq entries - calling fire_cwq_handlers() might not be good here. */ + while (!HIO_CWQ_IS_EMPTY(&hio->cwq)) + { + hio_cwq_t* cwq; + cwq = HIO_CWQ_HEAD(&hio->cwq); + HIO_CWQ_UNLINK (cwq); + hio_freemem (hio, cwq); + } + /* kill services before killing devices */ while (!HIO_SVCL_IS_EMPTY(&hio->actsvc)) { diff --git a/lib/http-cgi.c b/lib/http-cgi.c index 97c01d3..47bbfe0 100644 --- a/lib/http-cgi.c +++ b/lib/http-cgi.c @@ -865,6 +865,10 @@ static void unbind_task_from_peer (cgi_t* cgi, int rcdown) if (cgi->peer) { + cgi_peer_xtn_t* peer_xtn; + peer_xtn = hio_dev_pro_getxtn(cgi->peer); + peer_xtn->cgi = HIO_NULL; + hio_dev_pro_kill (cgi->peer); cgi->peer = HIO_NULL; n++; diff --git a/lib/http-fcgi.c b/lib/http-fcgi.c index 4426d8d..b78c3f9 100644 --- a/lib/http-fcgi.c +++ b/lib/http-fcgi.c @@ -697,7 +697,7 @@ static void unbind_task_from_peer (fcgi_t* fcgi, int rcdown) if (fcgi->peer) { - /* hio-svc_fcgic_untie() is not a delayed operation unlike hio_dev_sck_halt(). + /* hio_svc_fcgic_untie() is not a delayed operation unlike hio_dev_sck_halt(). * TODO: check if this is a buggy idea */ hio_svc_fcgic_untie (fcgi->peer); fcgi->peer = HIO_NULL; diff --git a/lib/http-prxy.c b/lib/http-prxy.c index 785de33..42ccf68 100644 --- a/lib/http-prxy.c +++ b/lib/http-prxy.c @@ -862,6 +862,10 @@ static void unbind_task_from_peer (prxy_t* prxy, int rcdown) if (prxy->peer) { + prxy_peer_xtn_t* peer_xtn; + peer_xtn = hio_dev_pro_getxtn(prxy->peer); + peer_xtn->prxy = HIO_NULL; + hio_dev_pro_kill (prxy->peer); prxy->peer = HIO_NULL; n++;