]> git.sesse.net Git - cubemap/commitdiff
Fix a crash bug on reload.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 2 Feb 2014 21:36:43 +0000 (22:36 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 2 Feb 2014 21:36:43 +0000 (22:36 +0100)
This could happen in the case where we reloaded while still waiting for
the request from a given client.

server.cpp

index f508710fbc24aaa431c3ef40888518fdc8c6bd21..ee91ed8449faa1c5c6b6b344dbc733ca000aa6c8 100644 (file)
@@ -482,6 +482,9 @@ sending_data_again:
 void Server::skip_lost_data(Client *client)
 {
        Stream *stream = client->stream;
 void Server::skip_lost_data(Client *client)
 {
        Stream *stream = client->stream;
+       if (stream == NULL) {
+               return;
+       }
        size_t bytes_to_send = stream->bytes_received - client->stream_pos;
        if (bytes_to_send > stream->backlog_size) {
                size_t bytes_lost = bytes_to_send - stream->backlog_size;
        size_t bytes_to_send = stream->bytes_received - client->stream_pos;
        if (bytes_to_send > stream->backlog_size) {
                size_t bytes_lost = bytes_to_send - stream->backlog_size;