Skip to content

mod_http3/include/h3_filter.h

Structs

Name
struct h3_conn_ctx_t

Types

Name
typedef struct h3_conn_ctx_t h3_conn_ctx_t

Functions

Name
apr_status_t h3_filter_out(ap_filter_t * f, apr_bucket_brigade * bb)
apr_status_t h3_filter_out_proto(ap_filter_t * f, apr_bucket_brigade * bb)
apr_status_t h3_filter_in_proto(ap_filter_t * f, apr_bucket_brigade * bb, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes)
apr_status_t h3_filter_in(ap_filter_t * f, apr_bucket_brigade * bb, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes)

Attributes

Name
ap_filter_rec_t * h3_net_out_filter_handle
ap_filter_rec_t * h3_net_in_filter_handle
ap_filter_rec_t * h3_proto_out_filter_handle
ap_filter_rec_t * h3_proto_in_filter_handle

Types Documentation

typedef h3_conn_ctx_t

typedef struct h3_conn_ctx_t h3_conn_ctx_t;

Functions Documentation

function h3_filter_out

apr_status_t h3_filter_out(
    ap_filter_t * f,
    apr_bucket_brigade * bb
)

Parameters:

  • f The filter handle (unused).
  • bb The outbound brigade to dispose of.

Return: APR_SUCCESS.

Network-layer output filter callback. Discards the brigade (the response is captured by the protocol-layer filter and submitted to nghttp3).

function h3_filter_out_proto

apr_status_t h3_filter_out_proto(
    ap_filter_t * f,
    apr_bucket_brigade * bb
)

Parameters:

  • f The filter handle.
  • bb The outbound brigade.

Return: APR_SUCCESS, or an APR error if pool/brigade access fails.

Protocol-layer output filter callback. Captures the response into the per-request h3_conn_ctx_t. In the default mode it submits headers early and feeds body bytes through a bounded per-stream queue with backpressure. When H3MaxResponseBodySize is finite, it retains bounded whole-response capture so an over-limit response can be replaced before transmission.

function h3_filter_in_proto

apr_status_t h3_filter_in_proto(
    ap_filter_t * f,
    apr_bucket_brigade * bb,
    ap_input_mode_t mode,
    apr_read_type_e block,
    apr_off_t readbytes
)

Return: APR_SUCCESS, with data and/or an EOS bucket inserted into bb.

Protocol-layer input filter callback. Serves the request body.

function h3_filter_in

apr_status_t h3_filter_in(
    ap_filter_t * f,
    apr_bucket_brigade * bb,
    ap_input_mode_t mode,
    apr_read_type_e block,
    apr_off_t readbytes
)

Return: APR_SUCCESS (with EOS bucket inserted) or APR_EOF.

Network-layer input filter callback. Unconditional EOS stub.

Attributes Documentation

variable h3_net_out_filter_handle

ap_filter_rec_t * h3_net_out_filter_handle;

variable h3_net_in_filter_handle

ap_filter_rec_t * h3_net_in_filter_handle;

variable h3_proto_out_filter_handle

ap_filter_rec_t * h3_proto_out_filter_handle;

variable h3_proto_in_filter_handle

ap_filter_rec_t * h3_proto_in_filter_handle;

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_FILTER_H
#define H3_FILTER_H

#include <httpd.h>

#include <http_protocol.h>

#include <apr_buckets.h>
#include <apr_pools.h>

struct h3_stream;

typedef struct h3_conn_ctx_t
{
    ap_bucket_response* resp;
    char* dataheap;
    apr_size_t dataheaplen;
    apr_size_t dataheapcap;
    apr_pool_t* c3reqpool;
    server_rec* s;
    int response_too_large;
    struct h3_stream* stream;
    int streaming;
} h3_conn_ctx_t;

extern ap_filter_rec_t* h3_net_out_filter_handle;
extern ap_filter_rec_t* h3_net_in_filter_handle;
extern ap_filter_rec_t* h3_proto_out_filter_handle;
extern ap_filter_rec_t* h3_proto_in_filter_handle;

apr_status_t h3_filter_out(ap_filter_t* f, apr_bucket_brigade* bb);

apr_status_t h3_filter_out_proto(ap_filter_t* f, apr_bucket_brigade* bb);

apr_status_t h3_filter_in_proto(ap_filter_t* f, apr_bucket_brigade* bb, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes);

apr_status_t h3_filter_in(ap_filter_t* f, apr_bucket_brigade* bb, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes);

#endif /* H3_FILTER_H */