SENTCONNECT TCP RST/TIMEOUT print IP in FAILED/CLOSED
Connect requests resulting in TCP ACK properly print the IP resolved and connected to by the exit in SUCCEEDED and CLOSED...
NEW torproject.org:80 PURPOSE=USER SENTCONNECT torproject.org:80 REMAP 154.35.132.70:80 SOURCE=EXIT SUCCEEDED 154.35.132.70:80 CLOSED 154.35.132.70:80 REASON=DONE
Yet those resulting in TCP RST or TIMEOUT fail to print the IP even though the IP is (if not it should be) returned and known to client in those cases as well...
NEW torproject.org:800 PURPOSE=USER SENTCONNECT torproject.org:800 FAILED torproject.org:800 REASON=END REMOTE_REASON=CONNECTREFUSED CLOSED torproject.org:800 REASON=END REMOTE_REASON=CONNECTREFUSED
NEW example.com:800 PURPOSE=USER SENTCONNECT example.com:800 DETACHED example.com:800 REASON=TIMEOUT ... FAILED example.com:800 REASON=CANT_ATTACH CLOSED example.com:800 REASON=CANT_ATTACH
Fix:
- Instead of the printing the SENTCONNECT fwd name, print the IP in those FAILED and CLOSED lines.
- The IP should also be printed in DETACHED if we have it (which we should if the TIMEOUT is being returned to us in a cell from the exit, as opposed to the client timing it out).
Also, in the case of a RST, it seems something (like CONNECTING, REMAP, DETACHED or some relavent label and line) could/should be printed between SENTCONNECT and FAILED.