X-Git-Url: https://git.sesse.net/?p=cubemap;a=blobdiff_plain;f=client.cpp;fp=client.cpp;h=eea41a5e0da43d40b0c468b206158f69198ac1b6;hp=f6361f34ab47e62dc30ec1ebd6844ae73462d21a;hb=ce0d42a14da5686366d0c73fa9b152e90619ff91;hpb=4ba4a9f0eac9777ef2d5071e980ae0d1ba22d048 diff --git a/client.cpp b/client.cpp index f6361f3..eea41a5 100644 --- a/client.cpp +++ b/client.cpp @@ -9,6 +9,10 @@ #include "state.pb.h" #include "stream.h" +#ifndef SO_MAX_PACING_RATE +#define SO_MAX_PACING_RATE 47 +#endif + using namespace std; Client::Client(int sock) @@ -80,6 +84,11 @@ Client::Client(const ClientProto &serialized, Stream *stream) } 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)"); + } + } } ClientProto Client::serialize() const