MCPcopy Create free account
hub / github.com/apache/httpd / h2_headers_rcreate

Function h2_headers_rcreate

modules/http2/h2_headers.c:152–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152h2_headers *h2_headers_rcreate(request_rec *r, int status,
153 const apr_table_t *header, apr_pool_t *pool)
154{
155 h2_headers *headers = h2_headers_create(status, header, r->notes, 0, pool);
156 ap_log_rerror(APLOG_MARK, APLOG_TRACE1, headers->status, r,
157 "h2_headers_rcreate(%ld): status=%d",
158 (long)r->connection->id, status);
159 if (headers->status == HTTP_FORBIDDEN) {
160 request_rec *r_prev;
161 for (r_prev = r; r_prev != NULL; r_prev = r_prev->prev) {
162 const char *cause = apr_table_get(r_prev->notes, "ssl-renegotiate-forbidden");
163 if (cause) {
164 /* This request triggered a TLS renegotiation that is not allowed
165 * in HTTP/2. Tell the client that it should use HTTP/1.1 for this.
166 */
167 ap_log_rerror(APLOG_MARK, APLOG_DEBUG, headers->status, r,
168 APLOGNO(10399)
169 "h2_headers(%ld): renegotiate forbidden, cause: %s",
170 (long)r->connection->id, cause);
171 headers->status = H2_ERR_HTTP_1_1_REQUIRED;
172 break;
173 }
174 }
175 }
176 if (is_unsafe(r->server)) {
177 apr_table_setn(headers->notes, H2_HDR_CONFORMANCE, H2_HDR_CONFORMANCE_UNSAFE);
178 }
179 if (h2_config_rgeti(r, H2_CONF_PUSH) == 0 && h2_config_sgeti(r->server, H2_CONF_PUSH) != 0) {
180 apr_table_setn(headers->notes, H2_PUSH_MODE_NOTE, "0");
181 }
182 return headers;
183}
184
185h2_headers *h2_headers_copy(apr_pool_t *pool, h2_headers *h)
186{

Callers 2

create_responseFunction · 0.85

Calls 4

h2_headers_createFunction · 0.85
h2_config_rgetiFunction · 0.85
h2_config_sgetiFunction · 0.85
is_unsafeFunction · 0.70

Tested by

no test coverage detected