mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-12 06:24:56 +00:00
MINOR: stream: detach the stream from its own task on stream_free()
This makes sure that the stream is not visible from its own task just before starting to free some of its components. This way we have the guarantee that a stream found in a task list is totally valid and can safely be dereferenced.
This commit is contained in:
parent
29bf96d73d
commit
0ad46fa6f5
@ -364,6 +364,12 @@ static void stream_free(struct stream *s)
|
|||||||
int must_free_sess;
|
int must_free_sess;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
/* detach the stream from its own task before even releasing it so
|
||||||
|
* that walking over a task list never exhibits a dying stream.
|
||||||
|
*/
|
||||||
|
s->task->context = NULL;
|
||||||
|
__ha_barrier_store();
|
||||||
|
|
||||||
pendconn_free(s);
|
pendconn_free(s);
|
||||||
|
|
||||||
if (objt_server(s->target)) { /* there may be requests left pending in queue */
|
if (objt_server(s->target)) { /* there may be requests left pending in queue */
|
||||||
|
Loading…
Reference in New Issue
Block a user