zaphoyd / websocketpp

C++ websocket client/server library
http://www.zaphoyd.com/websocketpp
Other
6.95k stars 1.96k forks source link

Server uses wrong MSS #696

Open krzysiek6d opened 6 years ago

krzysiek6d commented 6 years ago

Hi

Something is wrong when you accept new connection. This leads to problems when you want enable jumbo frames in your network. Here is how to reproduce it on localhost, but the real environment would be between two machines - and the behaviour is the same.

Simulate jumbo frame support on localhost: $ sudo ip link set mtu 2500 dev lo

run ws server and connect 'curl http://localhost:9002:

 $ ./wss_server             
on http
MTU: 2500 MSS: 1448
[2017-12-19 22:33:14] [http] localhost:9002 127.0.0.1:48518 "GET / HTTP/1.1" 200 5018 "curl/7.57.0" 

run asio echo server and connect 'telnet localhost 8888'

 $ ./asio_server 8888
session: MTU: 2500 MSS: 2448

You can see that for websocket connection wrong MSS is calculated. In attachement you can see two directories:

asio_async_server asio_async_server conatins asio server from boost asio examples with MTU/MSS debugging infomation. Building:

mkdir bin
cd bin
cmake ..
make

Running on i.e. port 8888 ./asio_server 8888 Connecting - from another console telnet localhost 8888

wss wss server conatins websocketpp server based on example code from your repository. Server is running on port 9002 Building

mkdir bin
cd bin
cmake ..
make

Running ./wss_server Connecting - from another console curl http://localhost:9002

Br, krzysiek6d bug.zip

krzysiek6d commented 2 years ago

Sorry for closing it so lately ;) thanks!