Commit ffc66bf4 authored by jan.koester's avatar jan.koester
Browse files

test

parent 576794be
Loading
Loading
Loading
Loading
+15 −2
Changes for src/quic.cpp: 15 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -2344,6 +2344,15 @@ std::vector<uint8_t> quic::buildTransportParameters() {
    params.insert(params.end(), timeout_len_buf, timeout_len_buf + timeout_len_size);
    params.insert(params.end(), timeout_buf, timeout_buf + timeout_len);

    // max_udp_payload_size (0x03) — advertise 1472 (Ethernet-safe)
    params.push_back(0x03);
    uint8_t mups_buf[8];
    size_t mups_len = encodeVarInt(1472, mups_buf);
    uint8_t mups_len_buf[8];
    size_t mups_len_size = encodeVarInt(mups_len, mups_len_buf);
    params.insert(params.end(), mups_len_buf, mups_len_buf + mups_len_size);
    params.insert(params.end(), mups_buf, mups_buf + mups_len);

    return params;
}

@@ -4486,7 +4495,9 @@ size_t quic::sendData(buffer& data, int flags) {
    // Build STREAM frames in QUIC datagram chunks
    const size_t header_overhead = 1 + _remote_cid.size() + 4 + 16;
    const size_t frame_hdr_max = 1 + 8 + 8 + 8;
    const size_t max_datagram = _handshake_complete ? 1350 : 1200;
    const size_t max_datagram = _handshake_complete
        ? static_cast<size_t>(_max_udp_payload)
        : 1200;
    const size_t max_chunk = max_datagram - header_overhead - frame_hdr_max;

    size_t sent_total = 0;
@@ -4564,7 +4575,9 @@ size_t quic::sendStreamData(uint64_t stream_id, const uint8_t* data, size_t len,
    // Chunk into QUIC datagrams for proper MTU handling
    const size_t header_overhead = 1 + _remote_cid.size() + 4 + 16;
    const size_t frame_hdr_max = 1 + 8 + 8 + 8;
    const size_t max_datagram = _handshake_complete ? 1350 : 1200;
    const size_t max_datagram = _handshake_complete
        ? static_cast<size_t>(_max_udp_payload)
        : 1200;
    const size_t max_chunk = max_datagram - header_overhead - frame_hdr_max;

    size_t sent_total = 0;
+1 −1
Changes for src/socket.h: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -856,7 +856,7 @@ namespace netplus {

		// Transport parameters
		uint64_t _max_idle_timeout = 30000;    // 30s
		uint64_t _max_udp_payload = 1200;      // Conservative default
		uint64_t _max_udp_payload = 1350;      // Safe post-handshake default (Ethernet-safe)
		uint64_t _active_connection_id_limit = 2;

		// Receive/send queues