1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
20 * @brief mod_request private header file
22 * @defgroup MOD_REQUEST mod_request
23 * @ingroup APACHE_MODS
31 #include "apr_buckets.h"
32 #include "apr_optional.h"
35 #include "util_filter.h"
42 extern module AP_MODULE_DECLARE_DATA request_module;
44 #define KEEP_BODY_FILTER "KEEP_BODY"
45 #define KEPT_BODY_FILTER "KEPT_BODY"
48 * Core per-directory configuration.
56 * Structure to store the contents of an HTTP form of the type
57 * application/x-www-form-urlencoded.
59 * Currently it contains the name as a char* of maximum length
60 * HUGE_STRING_LEN, and a value in the form of a bucket brigade
61 * of arbitrary length.
65 apr_bucket_brigade *value;
69 * Read the body and parse any form found, which must be of the
70 * type application/x-www-form-urlencoded.
72 * Name/value pairs are returned in an array, with the names as
73 * strings with a maximum length of HUGE_STRING_LEN, and the
74 * values as bucket brigades. This allows values to be arbitrarily
77 * All url-encoding is removed from both the names and the values
78 * on the fly. The names are interpreted as strings, while the
79 * values are interpreted as blocks of binary data, that may
80 * contain the 0 character.
82 * In order to ensure that resource limits are not exceeded, a
83 * maximum size must be provided. If the sum of the lengths of
84 * the names and the values exceed this size, this function
85 * will return HTTP_REQUEST_ENTITY_TOO_LARGE.
87 * An optional number of parameters can be provided, if the number
88 * of parameters provided exceeds this amount, this function will
89 * return HTTP_REQUEST_ENTITY_TOO_LARGE. If this value is negative,
90 * no limit is imposed, and the number of parameters is in turn
91 * constrained by the size parameter above.
93 * This function honours any kept_body configuration, and the
94 * original raw request body will be saved to the kept_body brigade
95 * if so configured, just as ap_discard_request_body does.
97 * NOTE: File upload is not yet supported, but can be without change
98 * to the function call.
101 APR_DECLARE_OPTIONAL_FN(int, ap_parse_request_form, (request_rec * r, ap_filter_t * f,
102 apr_array_header_t ** ptr,
103 apr_size_t num, apr_size_t size));
105 APR_DECLARE_OPTIONAL_FN(void, ap_request_insert_filter, (request_rec * r));
107 APR_DECLARE_OPTIONAL_FN(void, ap_request_remove_filter, (request_rec * r));
113 #endif /* !MOD_REQUEST_H */