-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Respect socket's non blocking connect #1898
Comments
It would be a bit tricky to implement it this way. The usual flow is to call A simpler solution would be to follow the usual TCP proxy pattern - eagerly accept connection, kill it if we fail to connect to the real peer |
Why is it tricky though? |
Aaaah sorry. Yes. This should work |
Current implementation of the connect detour always waits for the other side to accept before it returns, while most applications nowadays set the socket to non blocking, then connect should immediately return with EINPROGRESS error code, indicating that the connect is in progress.
We can improve our implementation to check if socket is non blocking, and if it is, we setup the mirror listen socket, but don't accept until agent returns the result, to reproduce similar behavior (as much as possible).
The text was updated successfully, but these errors were encountered: