Commit 93bf4e4d authored by jan.koester's avatar jan.koester
Browse files

Fix compiler warnings: remove unused debug variables in quic.cpp

parent bc19909a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
libnetplus (20260424+21) unstable; urgency=medium

  * Fix compiler warnings: remove unused debug variables in quic.cpp

 -- Jan Koester <jan.koester@tuxist.de>  Thu, 24 Apr 2026 17:30:00 +0200

libnetplus (20260424+20) unstable; urgency=medium

  * Disable QUIC_DBG macro after HTTP/3 debugging complete
+6 −32
Original line number Diff line number Diff line
@@ -1191,21 +1191,8 @@ void quic::accept(std::unique_ptr<socket>& csock, bool nonblock) {
    
    dgram.resize(static_cast<size_t>(recv_len));

    {
        char peer_ip_dbg[INET6_ADDRSTRLEN] = {};
        uint16_t peer_port_dbg = 0;
        if (peer_addr.ss_family == AF_INET) {
            auto* sa4 = reinterpret_cast<struct sockaddr_in*>(&peer_addr);
            inet_ntop(AF_INET, &sa4->sin_addr, peer_ip_dbg, sizeof(peer_ip_dbg));
            peer_port_dbg = ntohs(sa4->sin_port);
        } else if (peer_addr.ss_family == AF_INET6) {
            auto* sa6 = reinterpret_cast<struct sockaddr_in6*>(&peer_addr);
            inet_ntop(AF_INET6, &sa6->sin6_addr, peer_ip_dbg, sizeof(peer_ip_dbg));
            peer_port_dbg = ntohs(sa6->sin6_port);
        }
        QUIC_DBG("accept: recv %zd bytes from %s:%u first_byte=0x%02x _Socket=%d",
                 recv_len, peer_ip_dbg, peer_port_dbg, dgram[0], _Socket);
    }
    QUIC_DBG("accept: recv %zd bytes first_byte=0x%02x _Socket=%d",
             recv_len, dgram[0], _Socket);
    
    // Check if this is a long header packet (Initial, Handshake, etc.)
    if ((dgram[0] & 0x80) == 0) {
@@ -1376,19 +1363,7 @@ void quic::accept(std::unique_ptr<socket>& csock, bool nonblock) {
    }
    QUIC_DBG("accept: NEW Initial from remote, creating child connection");
    
    {
        char peer_ip[INET6_ADDRSTRLEN] = {};
        uint16_t peer_port = 0;
        if (peer_addr.ss_family == AF_INET) {
            auto* sa4 = reinterpret_cast<struct sockaddr_in*>(&peer_addr);
            inet_ntop(AF_INET, &sa4->sin_addr, peer_ip, sizeof(peer_ip));
            peer_port = ntohs(sa4->sin_port);
        } else if (peer_addr.ss_family == AF_INET6) {
            auto* sa6 = reinterpret_cast<struct sockaddr_in6*>(&peer_addr);
            inet_ntop(AF_INET6, &sa6->sin6_addr, peer_ip, sizeof(peer_ip));
            peer_port = ntohs(sa6->sin6_port);
        }
    }

    
    // Verify supported version
    if (version != QUIC_VERSION_1 && version != QUIC_VERSION_2) {
@@ -2854,13 +2829,12 @@ void quic::processFrame(const uint8_t* data, size_t len, size_t& offset) {
            {
                // Error code
                size_t bytes;
                uint64_t error_code = decodeVarInt(&data[offset], bytes);
                (void)decodeVarInt(&data[offset], bytes);
                offset += bytes;
                
                uint64_t triggering_frame = 0;
                if (frame_type == 0x1c) {
                    // Frame type that triggered the error
                    triggering_frame = decodeVarInt(&data[offset], bytes);
                    // Frame type that triggered the error (skip)
                    (void)decodeVarInt(&data[offset], bytes);
                    offset += bytes;
                }