|
|
|
@ -204,6 +204,20 @@ void StreamTcpStreamCleanup(TcpStream *stream)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void StreamTcp3wsFreeQueue(TcpSession *ssn)
|
|
|
|
|
{
|
|
|
|
|
TcpStateQueue *q, *q_next;
|
|
|
|
|
q = ssn->queue;
|
|
|
|
|
while (q != NULL) {
|
|
|
|
|
q_next = q->next;
|
|
|
|
|
SCFree(q);
|
|
|
|
|
q = q_next;
|
|
|
|
|
StreamTcpDecrMemuse((uint64_t)sizeof(TcpStateQueue));
|
|
|
|
|
}
|
|
|
|
|
ssn->queue = NULL;
|
|
|
|
|
ssn->queue_len = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* \brief Session cleanup function. Does not free the ssn.
|
|
|
|
|
* \param ssn tcp session
|
|
|
|
@ -211,23 +225,13 @@ void StreamTcpStreamCleanup(TcpStream *stream)
|
|
|
|
|
void StreamTcpSessionCleanup(TcpSession *ssn)
|
|
|
|
|
{
|
|
|
|
|
SCEnter();
|
|
|
|
|
TcpStateQueue *q, *q_next;
|
|
|
|
|
|
|
|
|
|
if (ssn == NULL)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
StreamTcpStreamCleanup(&ssn->client);
|
|
|
|
|
StreamTcpStreamCleanup(&ssn->server);
|
|
|
|
|
|
|
|
|
|
q = ssn->queue;
|
|
|
|
|
while (q != NULL) {
|
|
|
|
|
q_next = q->next;
|
|
|
|
|
SCFree(q);
|
|
|
|
|
q = q_next;
|
|
|
|
|
StreamTcpDecrMemuse((uint64_t)sizeof(TcpStateQueue));
|
|
|
|
|
}
|
|
|
|
|
ssn->queue = NULL;
|
|
|
|
|
ssn->queue_len = 0;
|
|
|
|
|
StreamTcp3wsFreeQueue(ssn);
|
|
|
|
|
|
|
|
|
|
SCReturn;
|
|
|
|
|
}
|
|
|
|
|