diff --git a/include/types/proxy.h b/include/types/proxy.h index 5c078d9e4..641bc1c7b 100644 --- a/include/types/proxy.h +++ b/include/types/proxy.h @@ -325,7 +325,7 @@ struct proxy { struct list listener_queue; /* list of the temporarily limited listeners because of lack of a proxy resource */ struct stktable table; /* table for storing sticking sessions */ - struct task *task; /* the associated task, mandatory to manage rate limiting, stopping and resource shortage */ + struct task *task; /* the associated task, mandatory to manage rate limiting, stopping and resource shortage, NULL if disabled */ int grace; /* grace time after stop request */ char *check_req; /* HTTP or SSL request to use for PR_O_HTTP_CHK|PR_O_SSL3_CHK */ int check_len; /* Length of the HTTP or SSL3 request */ diff --git a/src/proxy.c b/src/proxy.c index 8db70b601..820be2fa5 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -609,7 +609,8 @@ void soft_stop(void) task_wakeup(p->table.sync_task, TASK_WOKEN_MSG); /* wake every proxy task up so that they can handle the stopping */ - task_wakeup(p->task, TASK_WOKEN_MSG); + if (p->task) + task_wakeup(p->task, TASK_WOKEN_MSG); p = p->next; }