mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-14 10:10:42 -07:00
We were setting the ping timer in the accepting server as soon as the leafnode connection is created, just after sending the INFO and setting the auth timer. Sending a PING too soon may cause the solicit side to process this PING and send a PONG in response, possibly before sending the CONNECT, which the accepting side would fail as an authentication error, since first protocol is expected to be a CONNECT. Since LeafNode always expect a CONNECT, we always set the auth timer. So now on accept, instead of starting the ping timer just after sending the INFO, we will delay setting this timer only after receiving the CONNECT. The auth timer will take care of a stale connection in the time it takes to receives the CONNECT. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
88 KiB
88 KiB