stream: Fix flushing when tls is disabled

pull/22/head
Andri Yngvason 2020-01-29 17:03:55 +00:00
parent 844645d63b
commit 10473597c5
1 changed files with 6 additions and 0 deletions

View File

@ -229,11 +229,14 @@ static void stream__on_readable(struct stream* self)
{ {
switch (self->state) { switch (self->state) {
case STREAM_STATE_NORMAL: case STREAM_STATE_NORMAL:
/* fallthrough */
#ifdef ENABLE_TLS #ifdef ENABLE_TLS
case STREAM_STATE_TLS_READY: case STREAM_STATE_TLS_READY:
#endif
if (self->on_event) if (self->on_event)
self->on_event(self, STREAM_EVENT_READ); self->on_event(self, STREAM_EVENT_READ);
break; break;
#ifdef ENABLE_TLS
case STREAM_STATE_TLS_HANDSHAKE: case STREAM_STATE_TLS_HANDSHAKE:
stream__try_tls_accept(self); stream__try_tls_accept(self);
break; break;
@ -248,10 +251,13 @@ static void stream__on_writable(struct stream* self)
{ {
switch (self->state) { switch (self->state) {
case STREAM_STATE_NORMAL: case STREAM_STATE_NORMAL:
/* fallthrough */
#ifdef ENABLE_TLS #ifdef ENABLE_TLS
case STREAM_STATE_TLS_READY: case STREAM_STATE_TLS_READY:
#endif
stream__flush(self); stream__flush(self);
break; break;
#ifdef ENABLE_TLS
case STREAM_STATE_TLS_HANDSHAKE: case STREAM_STATE_TLS_HANDSHAKE:
stream__try_tls_accept(self); stream__try_tls_accept(self);
break; break;