if (qcc_is_dead(qcc)) {
qc_release(qcc);
}
- else {
+ else if (qcc->task) {
if (qcc_may_expire(qcc))
qcc->task->expire = tick_add(now_ms, qcc->timeout);
else
qcc->wait_event.events = 0;
/* haproxy timeouts */
+ qcc->task = NULL;
qcc->timeout = prx->timeout.client;
- qcc->task = task_new_here();
- if (!qcc->task)
- goto fail_no_timeout_task;
- qcc->task->process = qc_timeout_task;
- qcc->task->context = qcc;
- qcc->task->expire = tick_add(now_ms, qcc->timeout);
+ if (tick_isset(qcc->timeout)) {
+ qcc->task = task_new_here();
+ if (!qcc->task)
+ goto fail_no_timeout_task;
+ qcc->task->process = qc_timeout_task;
+ qcc->task->context = qcc;
+ qcc->task->expire = tick_add(now_ms, qcc->timeout);
+ }
if (!conn_is_back(conn)) {
if (!LIST_INLIST(&conn->stopping_list)) {
if (qcc_is_dead(qcc)) {
qc_release(qcc);
}
- else {
+ else if (qcc->task) {
if (qcc_may_expire(qcc))
qcc->task->expire = tick_add(now_ms, qcc->timeout);
else