Commit 557d1a70 authored by jan.koester's avatar jan.koester
Browse files

win comp

parent 9d54a3d5
Loading
Loading
Loading
Loading
+5 −0
Changes for src/crypto/rsa.cpp: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -34,6 +34,11 @@
#include "random.h"
#include "rsa.h"

#if defined(_MSC_VER) && !defined(__clang__)
#define  __restrict__ __restrict
#endif // !__restrict__


namespace netplus {
    // Forward declaration for parseDERAndLoadRSA
    static bool parseDERAndLoadRSA(const std::vector<uint8_t>& derData, netplus::rsa& out_rsa);
+3 −3
Changes for src/event/iocp.cpp: 3 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -302,7 +302,7 @@ namespace netplus {

                    // ===== READ completion =====
                    if (buf->operation == OP_READ) {
                        std::lock_guard<std::mutex> lock(owner->event_mutex);
                        std::lock_guard<std::recursive_mutex> lock(owner->event_mutex);

                        // Push received data into socket buffer
                        if (bytes > 0) {
@@ -458,7 +458,7 @@ namespace netplus {
                            owner->slots[0].WritePending.store(false);
                            owner->slots[0].csock->setPendingWrite(false);

                            std::lock_guard<std::mutex> hsLock(owner->event_mutex);
                            std::lock_guard<std::recursive_mutex> hsLock(owner->event_mutex);
                            try {
                                owner->slots[0].csock->handshake_after_accept();

@@ -477,7 +477,7 @@ namespace netplus {

                        // Application write completion
                        {
                            std::lock_guard<std::mutex> lock(owner->event_mutex);
                            std::lock_guard<std::recursive_mutex> lock(owner->event_mutex);

                            owner->slots[0].WritePending.store(false);
                            owner->slots[0].csock->setPendingWrite(false);
+25 −4
Changes for src/quic.cpp: 25 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -86,10 +86,21 @@ quic::quic(const std::string& addr, int port, int maxconnections, int sockopts)
    // Enlarge the receive buffer so high-throughput clients don't
    // overrun the kernel queue between epoll_wait cycles.  4 MB keeps
    // up with ~3000 in-flight 1200-byte QUIC datagrams.

    int rcvbuf = 4 * 1024 * 1024;
    ::setsockopt(_Socket, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(rcvbuf));
    int sndbuf = 4 * 1024 * 1024;
    ::setsockopt(_Socket, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(sndbuf));

    #ifdef _WIN32
    const char* rcvopt = reinterpret_cast<const char*>(&rcvbuf);
    const char* sndopt = reinterpret_cast<const char*>(&sndbuf);
    #else
    int* rcvopt = &rcvbuf;
    int* sndopt = &sndbuf;
    #endif
        
    ::setsockopt(_Socket, SOL_SOCKET, SO_RCVBUF, rcvopt, sizeof(rcvbuf));
    
    ::setsockopt(_Socket, SOL_SOCKET, SO_SNDBUF, sndopt, sizeof(sndbuf));
    
    // Generate local connection ID for server
    generateConnectionId(_local_cid, 8);
@@ -110,9 +121,19 @@ quic::quic(const std::map<std::string, ssl::CertificateBundle>& certs,
    // overrun the kernel queue between epoll_wait cycles.  4 MB keeps
    // up with ~3000 in-flight 1200-byte QUIC datagrams.
    int rcvbuf = 4 * 1024 * 1024;
    ::setsockopt(_Socket, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(rcvbuf));
    int sndbuf = 4 * 1024 * 1024;
    ::setsockopt(_Socket, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(sndbuf));

#ifdef _WIN32
    const char* rcvopt = reinterpret_cast<const char*>(&rcvbuf);
    const char* sndopt = reinterpret_cast<const char*>(&sndbuf);
#else
    int* rcvopt = &rcvbuf;
    int* sndopt = &sndbuf;
#endif

    ::setsockopt(_Socket, SOL_SOCKET, SO_RCVBUF, rcvopt, sizeof(rcvbuf));
    
    ::setsockopt(_Socket, SOL_SOCKET, SO_SNDBUF, sndopt, sizeof(sndbuf));
    
    // Generate local connection ID for server
    generateConnectionId(_local_cid, 8);