github.com/krum110487/go-htaccess@v0.0.0-20240316004156-60641c8e7598/tests/data/apache_2_4_58/include/mod_http2.h (about)

     1  /* Licensed to the Apache Software Foundation (ASF) under one or more
     2   * contributor license agreements.  See the NOTICE file distributed with
     3   * this work for additional information regarding copyright ownership.
     4   * The ASF licenses this file to You under the Apache License, Version 2.0
     5   * (the "License"); you may not use this file except in compliance with
     6   * the License.  You may obtain a copy of the License at
     7   *
     8   *     http://www.apache.org/licenses/LICENSE-2.0
     9   *
    10   * Unless required by applicable law or agreed to in writing, software
    11   * distributed under the License is distributed on an "AS IS" BASIS,
    12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13   * See the License for the specific language governing permissions and
    14   * limitations under the License.
    15   */
    16  
    17  #ifndef __MOD_HTTP2_H__
    18  #define __MOD_HTTP2_H__
    19  
    20  /** The http2_var_lookup() optional function retrieves HTTP2 environment
    21   * variables. */
    22  APR_DECLARE_OPTIONAL_FN(char *, 
    23                          http2_var_lookup, (apr_pool_t *, server_rec *,
    24                                             conn_rec *, request_rec *,  char *));
    25  
    26  /** An optional function which returns non-zero if the given connection
    27   * or its master connection is using HTTP/2. */
    28  APR_DECLARE_OPTIONAL_FN(int, 
    29                          http2_is_h2, (conn_rec *));
    30  
    31  APR_DECLARE_OPTIONAL_FN(void,
    32                          http2_get_num_workers, (server_rec *s,
    33                                                  int *minw, int *max));
    34  
    35  #define AP_HTTP2_HAS_GET_POLLFD
    36  
    37  /**
    38   * Get a apr_pollfd_t populated for a h2 connection where
    39   * (c->master != NULL) is true and pipes are supported.
    40   * To be used in Apache modules implementing WebSockets in Apache httpd
    41   * versions that do not support the corresponding `ap_get_pollfd_from_conn()`
    42   * function.
    43   * When available, use `ap_get_pollfd_from_conn()` instead of this function.
    44   *
    45   * How it works: pass in a `apr_pollfd_t` which gets populated for
    46   * monitoring the input of connection `c`. If `c` is not a HTTP/2
    47   * stream connection, the function will return `APR_ENOTIMPL`.
    48   * `ptimeout` is optional and, if passed, will get the timeout in effect
    49   *
    50   * On platforms without support for pipes (e.g. Windows), this function
    51   * will return `APR_ENOTIMPL`.
    52   */
    53  APR_DECLARE_OPTIONAL_FN(apr_status_t,
    54                          http2_get_pollfd_from_conn,
    55                          (conn_rec *c, struct apr_pollfd_t *pfd,
    56                           apr_interval_time_t *ptimeout));
    57  
    58  /*******************************************************************************
    59   * START HTTP/2 request engines (DEPRECATED)
    60   ******************************************************************************/
    61  
    62  /* The following functions were introduced for the experimental mod_proxy_http2
    63   * support, but have been abandoned since.
    64   * They are still declared here for backward compatibility, in case someone
    65   * tries to build an old mod_proxy_http2 against it, but will disappear
    66   * completely sometime in the future.
    67   */ 
    68   
    69  struct apr_thread_cond_t;
    70  typedef struct h2_req_engine h2_req_engine;
    71  typedef void http2_output_consumed(void *ctx, conn_rec *c, apr_off_t consumed);
    72  
    73  typedef apr_status_t http2_req_engine_init(h2_req_engine *engine, 
    74                                             const char *id, 
    75                                             const char *type,
    76                                             apr_pool_t *pool, 
    77                                             apr_size_t req_buffer_size,
    78                                             request_rec *r,
    79                                             http2_output_consumed **pconsumed,
    80                                             void **pbaton);
    81  
    82  APR_DECLARE_OPTIONAL_FN(apr_status_t, 
    83                          http2_req_engine_push, (const char *engine_type, 
    84                                                  request_rec *r,
    85                                                  http2_req_engine_init *einit));
    86  
    87  APR_DECLARE_OPTIONAL_FN(apr_status_t, 
    88                          http2_req_engine_pull, (h2_req_engine *engine, 
    89                                                  apr_read_type_e block,
    90                                                  int capacity,
    91                                                  request_rec **pr));
    92  APR_DECLARE_OPTIONAL_FN(void, 
    93                          http2_req_engine_done, (h2_req_engine *engine, 
    94                                                  conn_rec *rconn,
    95                                                  apr_status_t status));
    96  
    97  
    98  /*******************************************************************************
    99   * END HTTP/2 request engines (DEPRECATED)
   100   ******************************************************************************/
   101  
   102  #endif