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

Function ap_proxy_http_process_response

modules/proxy/mod_proxy_http.c:1015–1851  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1013}
1014
1015static
1016int ap_proxy_http_process_response(proxy_http_req_t *req)
1017{
1018 apr_pool_t *p = req->p;
1019 request_rec *r = req->r;
1020 conn_rec *c = r->connection;
1021 proxy_worker *worker = req->worker;
1022 proxy_conn_rec *backend = req->backend;
1023 conn_rec *origin = req->origin;
1024 int do_100_continue = req->do_100_continue;
1025 int status;
1026
1027 char *buffer;
1028 char fixed_buffer[HUGE_STRING_LEN];
1029 const char *buf;
1030 char keepchar;
1031 apr_bucket *e;
1032 apr_bucket_brigade *bb;
1033 apr_bucket_brigade *pass_bb;
1034 int len, backasswards;
1035 int interim_response = 0; /* non-zero whilst interim 1xx responses
1036 * are being read. */
1037 apr_size_t response_field_size = 0;
1038 int pread_len = 0;
1039 apr_table_t *save_table;
1040 int backend_broke = 0;
1041 static const char *hop_by_hop_hdrs[] =
1042 {"Keep-Alive", "Proxy-Authenticate", "TE", "Trailer", "Upgrade", NULL};
1043 int i;
1044 const char *te = NULL;
1045 int original_status = r->status;
1046 int proxy_status = OK;
1047 const char *original_status_line = r->status_line;
1048 const char *proxy_status_line = NULL;
1049 apr_interval_time_t old_timeout = 0;
1050 proxy_dir_conf *dconf;
1051
1052 dconf = ap_get_module_config(r->per_dir_config, &proxy_module);
1053
1054 bb = apr_brigade_create(p, c->bucket_alloc);
1055 pass_bb = apr_brigade_create(p, c->bucket_alloc);
1056
1057 /* Only use dynamically sized buffer if user specifies ResponseFieldSize */
1058 if(backend->worker->s->response_field_size_set) {
1059 response_field_size = backend->worker->s->response_field_size;
1060
1061 if (response_field_size != HUGE_STRING_LEN)
1062 buffer = apr_pcalloc(p, response_field_size);
1063 else
1064 buffer = fixed_buffer;
1065 }
1066 else {
1067 response_field_size = HUGE_STRING_LEN;
1068 buffer = fixed_buffer;
1069 }
1070
1071 /* Setup for 100-Continue timeout if appropriate */
1072 if (do_100_continue && worker->s->ping_timeout_set) {

Callers 1

proxy_http_handlerFunction · 0.85

Calls 15

ap_get_module_configFunction · 0.85
ap_proxygetlineFunction · 0.85
ap_proxyerrorFunction · 0.85
ap_proxy_backend_brokeFunction · 0.85
ap_bucket_eoc_createFunction · 0.85
ap_pass_brigadeFunction · 0.85
ap_proxy_read_headersFunction · 0.85
ap_set_content_typeFunction · 0.85
ap_proxy_clean_warningsFunction · 0.85
ap_get_server_nameFunction · 0.85
ap_send_interim_responseFunction · 0.85

Tested by

no test coverage detected