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 f508710..ee91ed8 100644 (file)
@@ -482,6 +482,9 @@ sending_data_again:
 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;