Lines Matching refs:httpdmgr

218 	isc_httpdmgr_t *httpdmgr = httpd->mgr;
223 LOCK(&httpdmgr->lock);
226 ISC_LIST_UNLINK(httpdmgr->running, httpd, link);
230 isc_mem_put(httpdmgr->mctx, r.base, r.length);
235 isc_mem_put(httpdmgr->mctx, r.base, r.length);
238 isc_mem_put(httpdmgr->mctx, httpd, sizeof(isc_httpd_t));
240 UNLOCK(&httpdmgr->lock);
245 httpdmgr_destroy(httpdmgr);
255 isc_httpdmgr_t *httpdmgr;
263 httpdmgr = isc_mem_get(mctx, sizeof(isc_httpdmgr_t));
264 if (httpdmgr == NULL)
267 result = isc_mutex_init(&httpdmgr->lock);
269 isc_mem_put(mctx, httpdmgr, sizeof(isc_httpdmgr_t));
272 httpdmgr->mctx = NULL;
273 isc_mem_attach(mctx, &httpdmgr->mctx);
274 httpdmgr->sock = NULL;
275 isc_socket_attach(sock, &httpdmgr->sock);
276 httpdmgr->task = NULL;
277 isc_task_attach(task, &httpdmgr->task);
278 httpdmgr->timermgr = tmgr; /* XXXMLG no attach function? */
279 httpdmgr->client_ok = client_ok;
280 httpdmgr->ondestroy = ondestroy;
281 httpdmgr->cb_arg = cb_arg;
282 httpdmgr->flags = 0;
284 ISC_LIST_INIT(httpdmgr->running);
285 ISC_LIST_INIT(httpdmgr->urls);
298 result = isc_socket_accept(sock, task, isc_httpd_accept, httpdmgr);
302 httpdmgr->render_404 = render_404;
303 httpdmgr->render_500 = render_500;
305 *httpdmgrp = httpdmgr;
309 isc_task_detach(&httpdmgr->task);
310 isc_socket_detach(&httpdmgr->sock);
311 isc_mem_detach(&httpdmgr->mctx);
312 (void)isc_mutex_destroy(&httpdmgr->lock);
313 isc_mem_put(mctx, httpdmgr, sizeof(isc_httpdmgr_t));
318 httpdmgr_destroy(isc_httpdmgr_t *httpdmgr) {
324 LOCK(&httpdmgr->lock);
326 if (!MSHUTTINGDOWN(httpdmgr)) {
328 UNLOCK(&httpdmgr->lock);
335 if (!ISC_LIST_EMPTY(httpdmgr->running)) {
337 UNLOCK(&httpdmgr->lock);
343 isc_socket_detach(&httpdmgr->sock);
344 isc_task_detach(&httpdmgr->task);
345 httpdmgr->timermgr = NULL;
351 url = ISC_LIST_HEAD(httpdmgr->urls);
353 isc_mem_free(httpdmgr->mctx, url->url);
354 ISC_LIST_UNLINK(httpdmgr->urls, url, link);
355 isc_mem_put(httpdmgr->mctx, url, sizeof(isc_httpdurl_t));
356 url = ISC_LIST_HEAD(httpdmgr->urls);
359 UNLOCK(&httpdmgr->lock);
360 (void)isc_mutex_destroy(&httpdmgr->lock);
362 if (httpdmgr->ondestroy != NULL)
363 (httpdmgr->ondestroy)(httpdmgr->cb_arg);
365 mctx = httpdmgr->mctx;
366 isc_mem_putanddetach(&mctx, httpdmgr, sizeof(isc_httpdmgr_t));
606 isc_httpdmgr_t *httpdmgr = ev->ev_arg;
615 LOCK(&httpdmgr->lock);
616 if (MSHUTTINGDOWN(httpdmgr)) {
633 if (httpdmgr->client_ok != NULL &&
634 !(httpdmgr->client_ok)(&peeraddr, httpdmgr->cb_arg)) {
639 httpd = isc_mem_get(httpdmgr->mctx, sizeof(isc_httpd_t));
647 httpd->mgr = httpdmgr;
649 ISC_LIST_APPEND(httpdmgr->running, httpd, link);
658 headerdata = isc_mem_get(httpdmgr->mctx, HTTP_SENDGROW);
660 isc_mem_put(httpdmgr->mctx, httpd, sizeof(isc_httpd_t));
681 result = isc_socket_accept(httpdmgr->sock, task, isc_httpd_accept,
682 httpdmgr);
689 UNLOCK(&httpdmgr->lock);
691 httpdmgr_destroy(httpdmgr);
987 isc_httpdmgr_t *httpdmgr;
989 httpdmgr = *httpdmgrp;
994 LOCK(&httpdmgr->lock);
996 MSETSHUTTINGDOWN(httpdmgr);
998 isc_socket_cancel(httpdmgr->sock, httpdmgr->task, ISC_SOCKCANCEL_ALL);
1000 httpd = ISC_LIST_HEAD(httpdmgr->running);
1002 isc_socket_cancel(httpd->sock, httpdmgr->task,
1007 UNLOCK(&httpdmgr->lock);
1226 isc_httpdmgr_addurl(isc_httpdmgr_t *httpdmgr, const char *url,
1229 return (isc_httpdmgr_addurl2(httpdmgr, url, ISC_FALSE, func, arg));
1233 isc_httpdmgr_addurl2(isc_httpdmgr_t *httpdmgr, const char *url,
1240 httpdmgr->render_404 = func;
1244 item = isc_mem_get(httpdmgr->mctx, sizeof(isc_httpdurl_t));
1248 item->url = isc_mem_strdup(httpdmgr->mctx, url);
1250 isc_mem_put(httpdmgr->mctx, item, sizeof(isc_httpdurl_t));
1260 ISC_LIST_APPEND(httpdmgr->urls, item, link);