* Create a dummy request rec, simply so we can use ap_expr. * Use our short-lived pool for bucket_alloc so that we can simply move * buckets and use them after the backend connection is released. */
| 342 | * buckets and use them after the backend connection is released. |
| 343 | */ |
| 344 | static request_rec *create_request_rec(apr_pool_t *p, server_rec *s, |
| 345 | proxy_balancer *balancer, |
| 346 | const char *method, |
| 347 | const char *protocol) |
| 348 | { |
| 349 | request_rec *r; |
| 350 | |
| 351 | r = apr_pcalloc(p, sizeof(request_rec)); |
| 352 | r->pool = p; |
| 353 | r->server = s; |
| 354 | |
| 355 | r->per_dir_config = r->server->lookup_defaults; |
| 356 | if (balancer->section_config) { |
| 357 | r->per_dir_config = ap_merge_per_dir_configs(r->pool, |
| 358 | r->per_dir_config, |
| 359 | balancer->section_config); |
| 360 | } |
| 361 | |
| 362 | r->proxyreq = PROXYREQ_RESPONSE; |
| 363 | |
| 364 | r->user = NULL; |
| 365 | r->ap_auth_type = NULL; |
| 366 | |
| 367 | r->allowed_methods = ap_make_method_list(p, 2); |
| 368 | |
| 369 | r->headers_in = apr_table_make(r->pool, 1); |
| 370 | r->trailers_in = apr_table_make(r->pool, 1); |
| 371 | r->subprocess_env = apr_table_make(r->pool, 25); |
| 372 | r->headers_out = apr_table_make(r->pool, 12); |
| 373 | r->err_headers_out = apr_table_make(r->pool, 5); |
| 374 | r->trailers_out = apr_table_make(r->pool, 1); |
| 375 | r->notes = apr_table_make(r->pool, 5); |
| 376 | |
| 377 | r->request_config = ap_create_request_config(r->pool); |
| 378 | /* Must be set before we run create request hook */ |
| 379 | |
| 380 | r->sent_bodyct = 0; /* bytect isn't for body */ |
| 381 | |
| 382 | r->read_length = 0; |
| 383 | r->read_body = REQUEST_NO_BODY; |
| 384 | |
| 385 | r->status = HTTP_OK; /* Until further notice */ |
| 386 | r->the_request = NULL; |
| 387 | |
| 388 | /* Begin by presuming any module can make its own path_info assumptions, |
| 389 | * until some module interjects and changes the value. |
| 390 | */ |
| 391 | r->used_path_info = AP_REQ_DEFAULT_PATH_INFO; |
| 392 | |
| 393 | |
| 394 | /* Time to populate r with the data we have. */ |
| 395 | r->method = method; |
| 396 | /* Provide quick information about the request method as soon as known */ |
| 397 | r->method_number = ap_method_number_of(r->method); |
| 398 | if (r->method_number == M_OPTIONS |
| 399 | || (r->method_number == M_GET && r->method[0] == 'H')) { |
| 400 | r->header_only = 1; |
| 401 | } |
no test coverage detected