mod_request.c revision 185aa71728867671e105178b4c66fbc22b65ae26
0N/A/* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * mod_request.c --- HTTP routines to set aside or process request bodies. #
include "http_log.h" /* For errors detected in basic auth common/* Handles for core filters */ * This is the KEEP_BODY_INPUT filter for HTTP requests, for times when the * body should be set aside for future use by other modules. /* must we step out of the way? */ /* fail fast if the content length exceeds keep body */ * string (excluding leading space) (the endstr checks) * and a negative number. */ "Invalid Content-Length");
/* If we have a limit in effect and we know the C-L ahead of * time, stop it here if it is invalid. " is larger than the configured limit" /* get the brigade from upstream, and read it in to get its length */ /* does the length take us over the limit? */ " is larger than the configured limit" /* pass any errors downstream */ /* all is well, set aside the buckets */ * Initialisation of filter to handle a kept body on subrequests. * If a body is to be reinserted into a subrequest, any chunking will have * been removed from the body during storage. We need to change the request * from Transfer-Encoding: chunked to an explicit Content-Length. * Filter to handle a kept body on subrequests. * If a body has been previously kept by the request, and if a subrequest wants * to re-insert the body into the request, this input filter makes it happen. /* just get out of the way of things we don't want. */ /* set up the context if it does not already exist */ /* kept_body is finished, send next filter */ /* send all of the kept_body, but no more */ /* send part of the kept_body */ /* As above; this should not fail since the bucket has * a known length, but just to be sure, this takes * care of uncopyable buckets that do somehow manage /* XXX: check for failure? */ * Check whether this filter is not already present. * Add the KEEP_BODY filter to the request, if the admin wants to keep * the body using the KeptBodySize directive. * As a precaution, any pre-existing instances of either the kept_body or * keep_body filters will be removed before the filter is added. * Remove the kept_body and keep body filters from this specific request. return "KeptBodySize must be a valid size in bytes, or zero.";
"Maximum size of request bodies kept aside for use by filters"),
NULL,
/* create per-server config structure */ NULL,
/* merge per-server config structures */