]> git.sesse.net Git - cubemap/commitdiff
Fix a segfault on reload introduced by the pacing changes.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 23 Mar 2014 16:31:25 +0000 (17:31 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 23 Mar 2014 16:31:25 +0000 (17:31 +0100)
client.cpp

index eea41a5e0da43d40b0c468b206158f69198ac1b6..d0ab8f8fcdb163129a548f6ef1e9bddd6b88cc33 100644 (file)
@@ -84,9 +84,11 @@ Client::Client(const ClientProto &serialized, Stream *stream)
                }
                fwmark = 0;
        }
                }
                fwmark = 0;
        }
-       if (setsockopt(sock, SOL_SOCKET, SO_MAX_PACING_RATE, &stream->pacing_rate, sizeof(stream->pacing_rate)) == -1) {
-               if (stream->pacing_rate != ~0U) {
-                       log_perror("setsockopt(SO_MAX_PACING_RATE)");
+       if (stream != NULL) {
+               if (setsockopt(sock, SOL_SOCKET, SO_MAX_PACING_RATE, &stream->pacing_rate, sizeof(stream->pacing_rate)) == -1) {
+                       if (stream->pacing_rate != ~0U) {
+                               log_perror("setsockopt(SO_MAX_PACING_RATE)");
+                       }
                }
        }
 }
                }
        }
 }