#include "apr_buckets.h"
#include "apr_poll.h"
#include "apr_thread_proc.h"
+#include "apr_hash.h"
#include "os.h"
#ifndef DEFAULT_LIMIT_REQUEST_FIELDS
#define DEFAULT_LIMIT_REQUEST_FIELDS 100
#endif
+/** default/hard limit on number of leading/trailing empty lines */
+#ifndef DEFAULT_LIMIT_BLANK_LINES
+#define DEFAULT_LIMIT_BLANK_LINES 10
+#endif
/**
* The default default character set name to add if AddDefaultCharset is
#define HTTP_UNSUPPORTED_MEDIA_TYPE 415
#define HTTP_RANGE_NOT_SATISFIABLE 416
#define HTTP_EXPECTATION_FAILED 417
+#define HTTP_IM_A_TEAPOT 418
+#define HTTP_MISDIRECTED_REQUEST 421
#define HTTP_UNPROCESSABLE_ENTITY 422
#define HTTP_LOCKED 423
#define HTTP_FAILED_DEPENDENCY 424
#define M_BASELINE_CONTROL 24
#define M_MERGE 25
#define M_INVALID 26 /** no valid method */
+#define M_BREW 27 /** RFC 2324: HTCPCP/1.0 */
+#define M_WHEN 28 /** RFC 2324: HTCPCP/1.0 */
/**
* METHODS needs to be equal to the number of bits
char *uri;
/** The filename on disk corresponding to this response */
char *filename;
- /* XXX: What does this mean? Please define "canonicalize" -aaron */
- /** The true filename, we canonicalize r->filename if these don't match */
+ /** The true filename stored in the filesystem, as in the true alpha case
+ * and alias correction, e.g. "Image.jpeg" not "IMAGE$1.JPE" on Windows.
+ * The core map_to_storage canonicalizes r->filename when they mismatch */
char *canonical_filename;
/** The PATH_INFO extracted from this request */
char *path_info;
conn_state_t *cs;
/** Is there data pending in the input filters? */
int data_in_input_filters;
- /** Is there data pending in the output filters? */
+ /** No longer used, replaced with ap_filter_should_yield() */
int data_in_output_filters;
/** Are there any filters that clogg/buffer the input stream, breaking
/** Context under which this connection was suspended */
void *suspended_baton;
+
+ /** Array of requests being handled under this connection. */
+ apr_array_header_t *requests;
+
+ /** Empty bucket brigade */
+ apr_bucket_brigade *empty;
+
+ /** Hashtable of filters with setaside buckets for write completion */
+ apr_hash_t *filters;
+
+ /** The minimum level of filter type to allow setaside buckets */
+ int async_filter;
};
struct conn_slave_rec {
/** limit on number of request header fields */
int limit_req_fields;
-
/** Opaque storage location */
void *context;
+
+ /** Whether the keepalive timeout is explicit (1) or
+ * inherited (0) from the base server (either first
+ * server on the same IP:port or main server) */
+ unsigned int keep_alive_timeout_set:1;
};
/**
*/
AP_DECLARE(char *) ap_getword_conf_nc(apr_pool_t *p, char **line);
+/**
+ * Get the second word in the string paying attention to quoting,
+ * with {...} supported as well as "..." and '...'
+ * @param p The pool to allocate from
+ * @param line The line to traverse
+ * @return A copy of the string
+ */
+AP_DECLARE(char *) ap_getword_conf2(apr_pool_t *p, const char **line);
+
+/**
+ * Get the second word in the string paying attention to quoting,
+ * with {...} supported as well as "..." and '...'
+ * @param p The pool to allocate from
+ * @param line The line to traverse
+ * @return A copy of the string
+ * @note The same as ap_getword_conf2(), except it doesn't use const char **.
+ */
+AP_DECLARE(char *) ap_getword_conf2_nc(apr_pool_t *p, char **line);
+
/**
* Check a string for any config define or environment variable construct
* and replace each of them by the value of that variable, if it exists.
AP_FN_ATTR_NONNULL_ALL;
/**
- * Test if the given path has an an absolute path.
+ * Test if the given path has an absolute path.
* @param p The pool to allocate from
* @param dir The directory name
* @note The converse is not necessarily true, some OS's (Win32/OS2/Netware) have
AP_FN_ATTR_NONNULL_ALL;
/**
- * Determine if a string matches a patterm containing the wildcards '?' or '*'
+ * Determine if a string matches a pattern containing the wildcards '?' or '*'
* @param str The string to check
* @param expected The pattern to match against
* @return 0 if the two strings match, 1 otherwise
AP_FN_ATTR_NONNULL_ALL;
/**
- * Determine if a string matches a patterm containing the wildcards '?' or '*',
+ * Determine if a string matches a pattern containing the wildcards '?' or '*',
* ignoring case
* @param str The string to check
* @param expected The pattern to match against
#define AP_NORESTART APR_OS_START_USEERR + 1
+/**
+ * Get the first index of the string in the array or -1 if not found. Start
+ * searching a start.
+ * @param array The array the check
+ * @param s The string to find
+ * @param start Start index for search. If start is out of bounds (negative or
+ equal to array length or greater), -1 will be returned.
+ * @return index of string in array or -1
+ */
+AP_DECLARE(int) ap_array_str_index(const apr_array_header_t *array,
+ const char *s,
+ int start);
+
+/**
+ * Check if the string is member of the given array by strcmp.
+ * @param array The array the check
+ * @param s The string to find
+ * @return !=0 iff string is member of array (via strcmp)
+ */
+AP_DECLARE(int) ap_array_str_contains(const apr_array_header_t *array,
+ const char *s);
+
+/**
+ * Known-fast version of strcasecmp(): ASCII case-folding, POSIX compliant
+ * @param s1 The 1st string to compare
+ * @param s2 The 2nd string to compare
+ * @return 0 if s1 is lexicographically equal to s2 ignoring case;
+ * non-0 otherwise.
+ */
+AP_DECLARE(int) ap_casecmpstr(const char *s1, const char *s2);
+
+/**
+ * Known-fast version of strncasecmp(): ASCII case-folding, POSIX compliant
+ * @param s1 The 1st string to compare
+ * @param s2 The 2nd string to compare
+ * @param n Maximum number of characters in the strings to compare
+ * @return 0 if s1 is lexicographically equal to s2 ignoring case;
+ * non-0 otherwise.
+ */
+AP_DECLARE(int) ap_casecmpstrn(const char *s1, const char *s2, apr_size_t n);
+
#ifdef __cplusplus
}
#endif