| 439 | const ap_bucket_response *res) |
| 440 | #else |
| 441 | apr_array_header_t *h2_push_collect(apr_pool_t *p, |
| 442 | const struct h2_request *req, |
| 443 | apr_uint32_t push_policy, |
| 444 | const struct h2_headers *res) |
| 445 | #endif |
| 446 | { |
| 447 | if (req && push_policy != H2_PUSH_NONE) { |
| 448 | /* Collect push candidates from the request/response pair. |
| 449 | * |
| 450 | * One source for pushes are "rel=preload" link headers |
| 451 | * in the response. |
| 452 | * |
| 453 | * TODO: This may be extended in the future by hooks or callbacks |
| 454 | * where other modules can provide push information directly. |
| 455 | */ |
| 456 | if (res->headers) { |
| 457 | link_ctx ctx; |
| 458 | |
| 459 | memset(&ctx, 0, sizeof(ctx)); |
| 460 | ctx.req = req; |
| 461 | ctx.push_policy = push_policy; |
| 462 | ctx.pool = p; |
| 463 | |
| 464 | apr_table_do(head_iter, &ctx, res->headers, NULL); |
| 465 | if (ctx.pushes) { |
| 466 | apr_table_setn(res->headers, "push-policy", |
| 467 | policy_str(push_policy)); |
| 468 | } |
| 469 | return ctx.pushes; |
| 470 | } |
| 471 | } |
| 472 | return NULL; |
| 473 | } |
| 474 | |
| 475 | #define GCSLOG_LEVEL APLOG_TRACE1 |
| 476 |
no test coverage detected