MEDIUM: connection: only call tcp_connect_probe when nothing was attempted yet

It was observed that after a failed send() on EAGAIN, a second connect()
would still be attempted in tcp_connect_probe() because there was no way
to know that a send() had failed.

By checking the WANT_WR status flag, we know if a previous write attempt
failed on EAGAIN, so we don't try to connect again if we know this has
already failed.

With this simple change, the second connect() has disappeared.
1 file changed