Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix instant RST/FIN after SYN/SYN-ACK/ACK (#12554)
Motivation: If you close the connection before the backend connects, the backend will keep connected until timeout. If you add logging, you will have sth like that: ``` 12:57:57.398 ProxyFrontendHandler channelActive 12:57:57.405 ProxyFrontendHandler channelInactive 12:57:57.431 ProxyBackendHandler channelActive ``` Ping between backend and frontend was about 50 ms, and the time difference between connecting and disconnecting was about 1 ms. Example code in Java to test frontend/backend: ``` while (true) { System.out.println("tick"); try { Socket socket = new Socket(); socket.connect(new InetSocketAddress("127.0.0.1", 8443), 3000); socket.close(); Thread.sleep(100); } catch (IOException ex) { ex.printStackTrace(); } } ``` Modification: Close backend connection if inbound is not active.
- Loading branch information