Blame modules/http2/h2_ngn_shed.h

Packit 90a5c9
/* Licensed to the Apache Software Foundation (ASF) under one or more
Packit 90a5c9
 * contributor license agreements.  See the NOTICE file distributed with
Packit 90a5c9
 * this work for additional information regarding copyright ownership.
Packit 90a5c9
 * The ASF licenses this file to You under the Apache License, Version 2.0
Packit 90a5c9
 * (the "License"); you may not use this file except in compliance with
Packit 90a5c9
 * the License.  You may obtain a copy of the License at
Packit 90a5c9
 *
Packit 90a5c9
 *     http://www.apache.org/licenses/LICENSE-2.0
Packit 90a5c9
 *
Packit 90a5c9
 * Unless required by applicable law or agreed to in writing, software
Packit 90a5c9
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 90a5c9
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 90a5c9
 * See the License for the specific language governing permissions and
Packit 90a5c9
 * limitations under the License.
Packit 90a5c9
 */
Packit 90a5c9
Packit 90a5c9
#ifndef h2_req_shed_h
Packit 90a5c9
#define h2_req_shed_h
Packit 90a5c9
Packit 90a5c9
struct h2_req_engine;
Packit 90a5c9
struct h2_task;
Packit 90a5c9
Packit 90a5c9
typedef struct h2_ngn_shed h2_ngn_shed;
Packit 90a5c9
struct h2_ngn_shed {
Packit 90a5c9
    conn_rec *c;
Packit 90a5c9
    apr_pool_t *pool;
Packit 90a5c9
    apr_hash_t *ngns;
Packit 90a5c9
    void *user_ctx;
Packit 90a5c9
    
Packit 90a5c9
    unsigned int aborted : 1;
Packit 90a5c9
    
Packit 90a5c9
    int default_capacity;
Packit 90a5c9
    apr_size_t req_buffer_size; /* preferred buffer size for responses */
Packit 90a5c9
};
Packit 90a5c9
Packit 90a5c9
const char *h2_req_engine_get_id(h2_req_engine *engine);
Packit 90a5c9
int h2_req_engine_is_shutdown(h2_req_engine *engine);
Packit 90a5c9
Packit 90a5c9
void h2_req_engine_out_consumed(h2_req_engine *engine, conn_rec *c, 
Packit 90a5c9
                                apr_off_t bytes);
Packit 90a5c9
Packit 90a5c9
typedef apr_status_t h2_shed_ngn_init(h2_req_engine *engine, 
Packit 90a5c9
                                      const char *id, 
Packit 90a5c9
                                      const char *type,
Packit 90a5c9
                                      apr_pool_t *pool, 
Packit 90a5c9
                                      apr_size_t req_buffer_size,
Packit 90a5c9
                                      request_rec *r,
Packit 90a5c9
                                      h2_output_consumed **pconsumed,
Packit 90a5c9
                                      void **pbaton);
Packit 90a5c9
Packit 90a5c9
h2_ngn_shed *h2_ngn_shed_create(apr_pool_t *pool, conn_rec *c,
Packit 90a5c9
                                int default_capactiy, 
Packit 90a5c9
                                apr_size_t req_buffer_size); 
Packit 90a5c9
Packit 90a5c9
void h2_ngn_shed_destroy(h2_ngn_shed *shed);
Packit 90a5c9
Packit 90a5c9
void h2_ngn_shed_set_ctx(h2_ngn_shed *shed, void *user_ctx);
Packit 90a5c9
void *h2_ngn_shed_get_ctx(h2_ngn_shed *shed);
Packit 90a5c9
Packit 90a5c9
h2_ngn_shed *h2_ngn_shed_get_shed(struct h2_req_engine *ngn);
Packit 90a5c9
Packit 90a5c9
void h2_ngn_shed_abort(h2_ngn_shed *shed);
Packit 90a5c9
Packit 90a5c9
apr_status_t h2_ngn_shed_push_request(h2_ngn_shed *shed, const char *ngn_type, 
Packit 90a5c9
                                      request_rec *r, 
Packit 90a5c9
                                      h2_shed_ngn_init *init_cb);
Packit 90a5c9
Packit 90a5c9
apr_status_t h2_ngn_shed_pull_request(h2_ngn_shed *shed, h2_req_engine *pub_ngn, 
Packit 90a5c9
                                      int capacity, 
Packit 90a5c9
                                      int want_shutdown, request_rec **pr);
Packit 90a5c9
Packit 90a5c9
apr_status_t h2_ngn_shed_done_task(h2_ngn_shed *shed, 
Packit 90a5c9
                                   struct h2_req_engine *ngn, 
Packit 90a5c9
                                   struct h2_task *task);
Packit 90a5c9
Packit 90a5c9
void h2_ngn_shed_done_ngn(h2_ngn_shed *shed, struct h2_req_engine *ngn);
Packit 90a5c9
Packit 90a5c9
Packit 90a5c9
#endif /* h2_req_shed_h */