mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-12-04 10:58:31 +00:00
In Dispatcher.TCPSniff, any error returned by sniffDomain incremented skipList[dstIP:port], including connections that closed or were canceled before sending a single application byte (such as speculative browser pre-connects or Happy Eyeballs races). Six such zero-byte closures disabled SNI sniffing for all domains sharing that IP:port for the full 600 s TTL. Skip caching the failure when conn.Buffered() == 0 and the error is a connection-closed or cancellation error (io.EOF, io.ErrUnexpectedEOF, net.ErrClosed, syscall.ECONNRESET, context.Canceled, etc.), while still counting server-first read timeouts (os.ErrDeadlineExceeded) and unrecognized or truncated payloads. Fixes #3527