Don't compress in EchoServer if large message
This commit is contained in:
@@ -33,7 +33,10 @@ int main() {
|
||||
|
||||
},
|
||||
.message = [](auto *ws, std::string_view message, uWS::OpCode opCode) {
|
||||
ws->send(message, opCode, true);
|
||||
/* This is the opposite of what you probably want; compress if message is LARGER than 16 kb
|
||||
* the reason we do the opposite here; compress if SMALLER than 16 kb is to allow for
|
||||
* benchmarking of large message sending without compression */
|
||||
ws->send(message, opCode, message.length() < 16 * 1024);
|
||||
},
|
||||
.drain = [](auto */*ws*/) {
|
||||
/* Check ws->getBufferedAmount() here */
|
||||
|
||||
Reference in New Issue
Block a user