diff --git a/source4/lib/tls/tls_tstream.c b/source4/lib/tls/tls_tstream.c index 364bb421078..347c47ed48e 100644 --- a/source4/lib/tls/tls_tstream.c +++ b/source4/lib/tls/tls_tstream.c @@ -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,