From 235107473ceef239747e9995365489899aa90cca Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 23 Jul 2015 18:23:48 +0200 Subject: [PATCH] Make the SENDING_HEADER state fall through. In the case where we really are in WAITING_KEYFRAME, we will go to sleep immediately in the state below, but there's also a case where we could end up directly in SENDING_DATA and don't want to wait for the stream to get more data to start sending. --- server.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.cpp b/server.cpp index d811818..14162f5 100644 --- a/server.cpp +++ b/server.cpp @@ -479,12 +479,12 @@ sending_header_or_error_again: stream->bytes_received - stream->backlog_size, 0); client->state = Client::SENDING_DATA; + goto sending_data; } else { client->stream_pos = stream->bytes_received; client->state = Client::WAITING_FOR_KEYFRAME; } - stream->put_client_to_sleep(client); - return; + // Fall through. } case Client::WAITING_FOR_KEYFRAME: { Stream *stream = client->stream; @@ -514,6 +514,7 @@ sending_header_or_error_again: // Fall through. } case Client::SENDING_DATA: { +sending_data: skip_lost_data(client); Stream *stream = client->stream; -- 2.39.2