~cpick/mongrel2/release

« back to all changes in this revision

Viewing changes to src/host.c

  • Committer: Chris Pick
  • Date: 2013-06-30 16:39:57 UTC
  • mfrom: (1106.1.15)
  • Revision ID: git-v1:ec39967acb6bc9867ed9b9dc3774304ca6b9c294
Merge tag 'v1.8.1' into debian

Hotfix for github issue 148

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
void backend_destroy_cb(Route *r, RouteMap *map)
47
47
{
 
48
    (void)map;
 
49
 
48
50
    Backend *backend = (Backend *)r->data;
49
51
 
50
52
    if(backend) {
 
53
        if(backend->type == BACKEND_DIR) {
 
54
            Dir_destroy(backend->target.dir);
 
55
        } else if(backend->type == BACKEND_HANDLER) {
 
56
            // ignore handlers since those are typically shared
 
57
        } else if(backend->type == BACKEND_PROXY) {
 
58
            Proxy_destroy(backend->target.proxy);
 
59
        } else {
 
60
            log_err("Invalid backend type, don't know how to destroy: %d", backend->type);
 
61
        }
 
62
 
51
63
        free(backend);
52
64
        r->data = NULL;
53
65
    }