Skip to content

mod_http3/include/h3_stream.h

Functions

Name
void flush_nghttp3(h3_session * session)
h3_stream * track_stream(h3_session * session, int64_t sid, quic_stream * qstream)
apr_array_header_t * drain_ready_streams(h3_session * session, apr_pool_t * loop_pool, int * data_read)
h3_stream * h3_stream_find(h3_session * session, int64_t sid)

Functions Documentation

function flush_nghttp3

void flush_nghttp3(
    h3_session * session
)

Parameters:

  • session The session whose nghttp3 state to flush.

Drive the nghttp3 connection: build any pending outbound frames and write them onto the QUIC connection. Safe to call repeatedly; no-ops if there is nothing to send.

function track_stream

h3_stream * track_stream(
    h3_session * session,
    int64_t sid,
    quic_stream * qstream
)

Parameters:

  • session The session that owns the stream.
  • sid The QUIC stream id (RFC 9000).
  • qstream The QUIC stream object backing the new stream.

Return: The new h3_stream, or NULL on allocation failure.

Allocate and register a new h3_stream for the given stream id.

function drain_ready_streams

apr_array_header_t * drain_ready_streams(
    h3_session * session,
    apr_pool_t * loop_pool,
    int * data_read
)

Parameters:

  • session The session.
  • loop_pool Scratch pool for per-iteration allocations.
  • data_read Out: set to non-zero if any stream data was read, else zero.

Return: Array of h3_stream* (possibly empty), allocated in loop_pool.

Read whatever's available on the underlying SSL stream and drive the matching nghttp3 stream state machine. Returns the set of streams that became fully readable (HEADERS+DATA complete) and ready for the request dispatcher.

function h3_stream_find

h3_stream * h3_stream_find(
    h3_session * session,
    int64_t sid
)

Parameters:

  • session The owning session.
  • sid The QUIC stream id to find.

Return: The matching h3_stream, or NULL if not present.

Look up an existing h3_stream by stream id.

Source code

/*
 * Copyright (c) 2026 The mod_http3 Project Authors. All rights reserved.
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef H3_STREAM_H
#define H3_STREAM_H

#include <httpd.h>

#include <apr_pools.h>

#include "quic.h"

#include "h3_session.h"

void flush_nghttp3(h3_session* session);

h3_stream* track_stream(h3_session* session, int64_t sid, quic_stream* qstream);

apr_array_header_t* drain_ready_streams(h3_session* session, apr_pool_t* loop_pool, int* data_read);

h3_stream* h3_stream_find(h3_session* session, int64_t sid);

#endif /* H3_STREAM_H */