mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-02-25 23:20:45 +00:00
BUG/MEDIUM: stream-int: always reset si->ops when si->end is nullified
It happened after changing the stream interface deinitialization sequence that we got random crashes with si_shutw() being called on NULL si->end. The reason was that si->ops was not reset after a call to si_release_endpoint() which is sometimes called directly. Thus we now move the resetting of si->ops just after any si->end assignment. It happens that si_detach() is now just the same as si_release_endpoint() and stream_int_unregister_handler(). Some cleanup will have to be performed there. It's not sure whether this problem can impact 1.5 since in 1.5 applets are part of the default embedded stream handler. The only way it could cause some trouble is if it's used with a connection, which doesn't seem possible at first glance.
This commit is contained in:
parent
152b81e7b2
commit
7365dad40f
@ -150,6 +150,7 @@ static inline void si_reset(struct stream_interface *si)
|
||||
si->flags &= SI_FL_ISBACK;
|
||||
si->end = NULL;
|
||||
si->state = si->prev_state = SI_ST_INI;
|
||||
si->ops = &si_embedded_ops;
|
||||
}
|
||||
|
||||
/* sets the current and previous state of a stream interface to <state>. This
|
||||
@ -182,12 +183,12 @@ static inline void si_release_endpoint(struct stream_interface *si)
|
||||
appctx_free(appctx); /* we share the connection pool */
|
||||
}
|
||||
si->end = NULL;
|
||||
si->ops = &si_embedded_ops;
|
||||
}
|
||||
|
||||
static inline void si_detach(struct stream_interface *si)
|
||||
{
|
||||
si_release_endpoint(si);
|
||||
si->ops = &si_embedded_ops;
|
||||
}
|
||||
|
||||
/* Turn a possibly existing connection endpoint of stream interface <si> to
|
||||
|
Loading…
Reference in New Issue
Block a user