+
+ // Many servers do not reliably send a close_notify alert when shutting
+ // down a connection, and instead terminate the TCP connection. This is
+ // reported as ERR_CONNECTION_CLOSED. Because of this, map the unclean
+ // shutdown to a graceful EOF, instead of treating it as an error as it
+ // should be.
+ if (*next_result == ERR_CONNECTION_CLOSED)
+ *next_result = 0;
+