/** The timeout for waiting for messages */
#ifndef DEFAULT_TIMEOUT
-#define DEFAULT_TIMEOUT 300
+#define DEFAULT_TIMEOUT 60
#endif
/** The timeout for waiting for keepalive timeout until next request */
apr_uri_t parsed_uri;
/** finfo.protection (st_mode) set to zero if no such file */
apr_finfo_t finfo;
+
+ /** remote address information from conn_rec, can be overridden if
+ * necessary by a module.
+ */
+ apr_sockaddr_t *client_addr;
+ char *client_ip;
};
/**
/** local address */
apr_sockaddr_t *local_addr;
/** remote address */
- apr_sockaddr_t *remote_addr;
+ apr_sockaddr_t *peer_addr;
/** Client's IP address */
- char *remote_ip;
+ char *peer_ip;
/** Client's DNS name, if known. NULL if DNS hasn't been checked,
* "" if it has and no address was found. N.B. Only access this though
* get_remote_host() */
void *sbh;
/** The bucket allocator to use for all bucket/brigade creations */
struct apr_bucket_alloc_t *bucket_alloc;
- /** The current state of this connection */
+ /** The current state of this connection; may be NULL if not used by MPM */
conn_state_t *cs;
/** Is there data pending in the input filters? */
int data_in_input_filters;
* @brief A structure to contain connection state information
*/
struct conn_state_t {
- /** APR_RING of expiration timeouts */
- APR_RING_ENTRY(conn_state_t) timeout_list;
- /** the expiration time of the next keepalive timeout */
- apr_time_t expiration_time;
- /** connection record this struct refers to */
- conn_rec *c;
- /** memory pool to allocate from */
- apr_pool_t *p;
- /** bucket allocator */
- apr_bucket_alloc_t *bucket_alloc;
- /** poll file descriptor information */
- apr_pollfd_t pfd;
/** Current state of the connection */
conn_state_e state;
};
*/
AP_DECLARE(int) ap_unescape_url_keep2f(char *url, int decode_slashes);
+/**
+ * Unescape an application/x-www-form-urlencoded string
+ * @param query The query to unescape
+ * @return 0 on success, non-zero otherwise
+ */
+AP_DECLARE(int) ap_unescape_urlencoded(char *query);
+
/**
* Convert all double slashes to single slashes
* @param name The string to convert
/** @see ap_os_escape_path */
#define ap_escape_uri(ppool,path) ap_os_escape_path(ppool,path,1)
+/**
+ * Escape a string as application/x-www-form-urlencoded
+ * @param p The pool to allocate from
+ * @param s The path to convert
+ * @return The converted URL
+ */
+AP_DECLARE(char *) ap_escape_urlencoded(apr_pool_t *p, const char *s);
+
+/**
+ * Escape a string as application/x-www-form-urlencoded, to a preallocated buffer
+ * @param c The preallocated buffer to write to
+ * @param s The path to convert
+ * @return The converted URL (c)
+ */
+AP_DECLARE(char *) ap_escape_urlencoded_buffer(char *c, const char *s);
+
/**
* Escape an html string
* @param p The pool to allocate from
/**
* After performing a successful regex match, you may use this function to
* perform a series of string substitutions based on subexpressions that were
- * matched during the call to ap_regexec
+ * matched during the call to ap_regexec. This function is limited to
+ * result strings of 64K. Consider using ap_pregsub_ex() instead.
* @param p The pool to allocate from
* @param input An arbitrary string containing $1 through $9. These are
* replaced with the corresponding matched sub-expressions
AP_DECLARE(char *) ap_pregsub(apr_pool_t *p, const char *input, const char *source,
size_t nmatch, ap_regmatch_t pmatch[]);
+/**
+ * After performing a successful regex match, you may use this function to
+ * perform a series of string substitutions based on subexpressions that were
+ * matched during the call to ap_regexec
+ * @param p The pool to allocate from
+ * @param result where to store the result, will be set to NULL on error
+ * @param input An arbitrary string containing $1 through $9. These are
+ * replaced with the corresponding matched sub-expressions
+ * @param source The string that was originally matched to the regex
+ * @param nmatch the nmatch returned from ap_pregex
+ * @param pmatch the pmatch array returned from ap_pregex
+ * @param maxlen the maximum string length to return, 0 for unlimited
+ * @return The substituted string, or NULL on error
+ */
+AP_DECLARE(apr_status_t) ap_pregsub_ex(apr_pool_t *p, char **result,
+ const char *input, const char *source,
+ size_t nmatch, ap_regmatch_t pmatch[],
+ apr_size_t maxlen);
+
/**
* We want to downcase the type/subtype for comparison purposes
* but nothing else because ;parameter=foo values are case sensitive.