]> granicus.if.org Git - apache/blob - modules/http2/h2_headers.h
On the 2.4.x branch:
[apache] / modules / http2 / h2_headers.h
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_h2__h2_headers__
18 #define __mod_h2__h2_headers__
19
20 #include "h2.h"
21
22 struct h2_bucket_beam;
23
24 extern const apr_bucket_type_t h2_bucket_type_headers;
25
26 #define H2_BUCKET_IS_HEADERS(e)     (e->type == &h2_bucket_type_headers)
27
28 apr_bucket * h2_bucket_headers_make(apr_bucket *b, h2_headers *r); 
29
30 apr_bucket * h2_bucket_headers_create(apr_bucket_alloc_t *list, 
31                                        h2_headers *r);
32                                        
33 h2_headers *h2_bucket_headers_get(apr_bucket *b);
34
35 apr_bucket *h2_bucket_headers_beam(struct h2_bucket_beam *beam,
36                                     apr_bucket_brigade *dest,
37                                     const apr_bucket *src);
38
39 /**
40  * Create the headers from the given status and headers
41  * @param status the headers status
42  * @param header the headers of the headers
43  * @param notes  the notes carried by the headers
44  * @param pool the memory pool to use
45  */
46 h2_headers *h2_headers_create(int status, apr_table_t *header, 
47                               apr_table_t *notes, apr_pool_t *pool);
48
49 /**
50  * Create the headers from the given request_rec.
51  * @param r the request record which was processed
52  * @param status the headers status
53  * @param header the headers of the headers
54  * @param pool the memory pool to use
55  */
56 h2_headers *h2_headers_rcreate(request_rec *r, int status, 
57                                  apr_table_t *header, apr_pool_t *pool);
58
59 /**
60  * Clone the headers into another pool. This will not copy any
61  * header strings.
62  */
63 h2_headers *h2_headers_copy(apr_pool_t *pool, h2_headers *h);
64
65 /**
66  * Create the headers for the given error.
67  * @param stream_id id of the stream to create the headers for
68  * @param type the error code
69  * @param req the original h2_request
70  * @param pool the memory pool to use
71  */
72 h2_headers *h2_headers_die(apr_status_t type,
73                              const struct h2_request *req, apr_pool_t *pool);
74
75 int h2_headers_are_response(h2_headers *headers);
76
77 #endif /* defined(__mod_h2__h2_headers__) */