char *test_Proxy_create_destroy() { Proxy *proxy = Proxy_create(bfromcstr("127.0.0.1"), 80); mu_assert(proxy != NULL, "Didn't make the proxy."); Proxy_destroy(proxy); return NULL; }
void backend_destroy_cb(Route *r, RouteMap *map) { (void)map; Backend *backend = (Backend *)r->data; if(backend) { if(backend->type == BACKEND_DIR) { Dir_destroy(backend->target.dir); } else if(backend->type == BACKEND_HANDLER) { // ignore handlers since those are typically shared } else if(backend->type == BACKEND_PROXY) { Proxy_destroy(backend->target.proxy); } else { log_err("Invalid backend type, don't know how to destroy: %d", backend->type); } free(backend); r->data = NULL; } }