trawick 00/10/18 10:42:44
Modified: src/main http_protocol.c src/include http_core.h Log: ap_get_client_block() now uses a brigade in core_request_config instead of a brigade in core_dir_conf. For now, getline() and ap_get_client_block() share a brigade. Revision Changes Path 1.189 +15 -8 apache-2.0/src/main/http_protocol.c Index: http_protocol.c =================================================================== RCS file: /home/cvs/apache-2.0/src/main/http_protocol.c,v retrieving revision 1.188 retrieving revision 1.189 diff -u -r1.188 -r1.189 --- http_protocol.c 2000/10/18 15:21:32 1.188 +++ http_protocol.c 2000/10/18 17:42:43 1.189 @@ -1363,6 +1363,7 @@ r->request_config = ap_create_request_config(r->pool); req_cfg = apr_pcalloc(r->pool, sizeof(core_request_config)); + req_cfg->bb = ap_brigade_create(r->pool); ap_set_module_config(r->request_config, &core_module, req_cfg); r->per_dir_config = r->server->lookup_defaults; @@ -2375,6 +2376,16 @@ return HTTP_REQUEST_ENTITY_TOO_LARGE; } +#ifdef AP_DEBUG + { + /* Make sure getline() didn't leave any droppings. */ + core_request_config *req_cfg = + (core_request_config *)ap_get_module_config(r->request_config, + &core_module); + AP_DEBUG_ASSERT(AP_BRIGADE_EMPTY(req_cfg->bb)); + } +#endif + return OK; } @@ -2439,14 +2450,10 @@ apr_int32_t timeout; ap_bucket *b, *old; const char *tempbuf; - core_dir_config *conf = - (core_dir_config *)ap_get_module_config(r->per_dir_config, - &core_module); - ap_bucket_brigade *bb = conf->bb; - - if (!bb) { - conf->bb = bb = ap_brigade_create(r->pool); - } + core_request_config *req_cfg = + (core_request_config *)ap_get_module_config(r->request_config, + &core_module); + ap_bucket_brigade *bb = req_cfg->bb; do { if (AP_BRIGADE_EMPTY(bb)) { 1.30 +2 -3 apache-2.0/src/include/http_core.h Index: http_core.h =================================================================== RCS file: /home/cvs/apache-2.0/src/include/http_core.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -r1.29 -r1.30 --- http_core.h 2000/10/18 15:21:30 1.29 +++ http_core.h 2000/10/18 17:42:44 1.30 @@ -321,7 +321,8 @@ /* Per-request configuration */ typedef struct { - /* bucket brigade used by getline for look-ahead */ + /* bucket brigade used by getline for look-ahead and + * ap_get_client_block for holding left-over request body */ struct ap_bucket_brigade *bb; } core_request_config; @@ -431,8 +432,6 @@ apr_array_header_t *output_filters; apr_array_header_t *input_filters; - /* bucket brigade held by ap_get_client_block() between calls */ - struct ap_bucket_brigade *bb; } core_dir_config; /* Per-server core configuration */