Commit 38f443ec authored by jan.koester's avatar jan.koester
Browse files

tet

parent de8878d1
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -135,6 +135,15 @@ quic::quic(const std::map<std::string, ssl::CertificateBundle>& certs,
    
    ::setsockopt(_Socket, SOL_SOCKET, SO_SNDBUF, sndopt, sizeof(sndbuf));

#ifdef Windows
    // Disable SIO_UDP_CONNRESET: on Windows, an ICMP "port unreachable"
    // response causes the next recvfrom to fail with WSAECONNRESET.
    BOOL bNewBehavior = FALSE;
    DWORD dwBytesReturned = 0;
    ::WSAIoctl(_Socket, SIO_UDP_CONNRESET, &bNewBehavior, sizeof(bNewBehavior),
              NULL, 0, &dwBytesReturned, NULL, NULL);
#endif

    // Generate local connection ID for server
    generateConnectionId(_local_cid, 8);
}
@@ -1141,7 +1150,7 @@ void quic::accept(std::unique_ptr<socket>& csock, bool nonblock) {
    if (recv_len < 0) {
#ifdef Windows
        int err = ::WSAGetLastError();
        if (err == WSAEWOULDBLOCK) {
        if (err == WSAEWOULDBLOCK || err == WSAECONNRESET || err == WSAENETRESET) {
            csock = nullptr;
            return;
        }