X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=server.cpp;h=14162f58e5a960cc37e35cb18796e270c883714e;hb=235107473ceef239747e9995365489899aa90cca;hp=8a8e867be1bf64f3cf47fc3a2c14e2dca37b9b4b;hpb=683141e8898415ba949161971b0c7f5508c92d14;p=cubemap diff --git a/server.cpp b/server.cpp index 8a8e867..14162f5 100644 --- a/server.cpp +++ b/server.cpp @@ -473,19 +473,18 @@ sending_header_or_error_again: // words, we won't send any of the backlog, but we'll start // sending immediately as we get the next keyframe block. // This is postcondition #3. + Stream *stream = client->stream; if (client->stream_pos == size_t(-2)) { client->stream_pos = std::min( - client->stream->bytes_received - client->stream->backlog_size, + stream->bytes_received - stream->backlog_size, 0); client->state = Client::SENDING_DATA; + goto sending_data; } else { - // client->stream_pos should be -1, but it might not be, - // if we have clients from an older version. - client->stream_pos = client->stream->bytes_received; + client->stream_pos = stream->bytes_received; client->state = Client::WAITING_FOR_KEYFRAME; } - client->stream->put_client_to_sleep(client); - return; + // Fall through. } case Client::WAITING_FOR_KEYFRAME: { Stream *stream = client->stream; @@ -515,6 +514,7 @@ sending_header_or_error_again: // Fall through. } case Client::SENDING_DATA: { +sending_data: skip_lost_data(client); Stream *stream = client->stream;