stream-gnutls: Don't flush until ready

websocket-tls
Andri Yngvason 2023-04-30 16:35:33 +00:00
parent c006936fd0
commit 34578aa5a4
1 changed files with 5 additions and 0 deletions

View File

@ -69,6 +69,10 @@ static void stream_gnutls_destroy(struct stream* self)
static int stream_gnutls__flush(struct stream* self)
{
if (self->state != STREAM_STATE_TLS_READY) {
return 0;
}
while (!TAILQ_EMPTY(&self->send_queue)) {
struct stream_req* req = TAILQ_FIRST(&self->send_queue);
@ -211,6 +215,7 @@ static int stream__try_tls_accept(struct stream* self)
if (rc == GNUTLS_E_SUCCESS) {
self->state = STREAM_STATE_TLS_READY;
stream__poll_r(self);
stream_gnutls__flush(self);
return 0;
}