1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s4:lib/tls: assert that event contexts are not mixed

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15621

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Stefan Metzmacher 2024-01-26 15:30:09 +01:00 committed by Andrew Bartlett
parent 6688945fa0
commit ac4bca7703

View File

@ -414,6 +414,12 @@ static struct tevent_req *tstream_tls_readv_send(TALLOC_CTX *mem_ctx,
struct tstream_tls_readv_state *state;
tlss->read.req = NULL;
if (tlss->current_ev != ev) {
SMB_ASSERT(tlss->push.subreq == NULL);
SMB_ASSERT(tlss->pull.subreq == NULL);
}
tlss->current_ev = ev;
req = tevent_req_create(mem_ctx, &state,
@ -578,6 +584,12 @@ static struct tevent_req *tstream_tls_writev_send(TALLOC_CTX *mem_ctx,
struct tstream_tls_writev_state *state;
tlss->write.req = NULL;
if (tlss->current_ev != ev) {
SMB_ASSERT(tlss->push.subreq == NULL);
SMB_ASSERT(tlss->pull.subreq == NULL);
}
tlss->current_ev = ev;
req = tevent_req_create(mem_ctx, &state,
@ -744,6 +756,12 @@ static struct tevent_req *tstream_tls_disconnect_send(TALLOC_CTX *mem_ctx,
struct tstream_tls_disconnect_state *state;
tlss->disconnect.req = NULL;
if (tlss->current_ev != ev) {
SMB_ASSERT(tlss->push.subreq == NULL);
SMB_ASSERT(tlss->pull.subreq == NULL);
}
tlss->current_ev = ev;
req = tevent_req_create(mem_ctx, &state,