예제 #1
0
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;
}
예제 #2
0
파일: host.c 프로젝트: 304471720/mongrel2
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;
    }
}