Before the handshare or disconnect is over we need to wait until
we delivered the lowlevel messages to the transport/kernel socket.
Otherwise we'll have a problem if another tevent_context is used
after the handshake.
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>
struct tevent_immediate *retry_im;
struct tevent_immediate *retry_im;
+ struct {
+ struct tevent_req *mgmt_req;
+ } waiting_flush;
+
struct {
uint8_t *buf;
off_t ofs;
struct {
uint8_t *buf;
off_t ofs;
tstream_context_data(stream,
struct tstream_tls);
tstream_context_data(stream,
struct tstream_tls);
+ if (tlss->push.subreq == NULL && tlss->pull.subreq == NULL) {
+ if (tlss->waiting_flush.mgmt_req != NULL) {
+ struct tevent_req *req = tlss->waiting_flush.mgmt_req;
+
+ tlss->waiting_flush.mgmt_req = NULL;
+
+ tevent_req_done(req);
+ return;
+ }
+ }
+
if (tlss->disconnect.req) {
tstream_tls_retry_disconnect(stream);
return;
if (tlss->disconnect.req) {
tstream_tls_retry_disconnect(stream);
return;
+ if (tlss->push.subreq != NULL || tlss->pull.subreq != NULL) {
+ tlss->waiting_flush.mgmt_req = req;
+ return;
+ }
+
+ if (tlss->push.subreq != NULL || tlss->pull.subreq != NULL) {
+ tlss->waiting_flush.mgmt_req = req;
+ return;
+ }
+