BUG/MINOR: dns: fix ring attach control on dns_session_new

Ths patch adds a control on ring_attach which can not currently fail
since we are the first to try to attach.

This should fix issue #1126
This commit is contained in:
Emeric Brun 2021-02-15 15:13:31 +01:00 committed by Christopher Faulet
parent 743afeed33
commit 0e40fda16a

View File

@ -1033,7 +1033,13 @@ struct dns_session *dns_session_new(struct dns_stream_server *dss)
goto error; goto error;
ring_init(&ds->ring, ds->tx_ring_area, DNS_TCP_MSG_RING_MAX_SIZE); ring_init(&ds->ring, ds->tx_ring_area, DNS_TCP_MSG_RING_MAX_SIZE);
ring_attach(&ds->ring); if (!ring_attach(&ds->ring)) {
/* Should never happen
* since we are the first attached
* here
*/
goto error;
}
if ((ds->task_exp = task_new(tid_bit)) == NULL) if ((ds->task_exp = task_new(tid_bit)) == NULL)
goto error; goto error;