rsocket / rsocket-java

Java implementation of RSocket
http://rsocket.io
Apache License 2.0
2.35k stars 354 forks source link

Limit max time for initial SETUP or RESUME frame to be received #1025

Closed rstoyanchev closed 2 years ago

rstoyanchev commented 3 years ago

The spec says:

Immediately upon successful connection, the client MUST send either a SETUP or RESUME frame with Stream ID of 0. Any other frame received that is NOT a SETUP|RESUME frame or a SETUP|RESUME frame with a Stream ID > 0, MUST cause the server to send an ERROR[INVALID_SETUP] and close the connection.

The server should have a configurable limit that determines how long to wait for the SETUP or RESUME frame to materialize or close the connection otherwise. This timeout should probably have some default value that is enforced out of the box but can be customized.

Note: originally reported in the Spring Framework issue tracker, as https://github.com/spring-projects/spring-framework/issues/27373, along with a repro project (see /dos_idle_connections and the server.sh script).