Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions include/ap_mmn.h
Original file line number Diff line number Diff line change
Expand Up @@ -646,14 +646,16 @@
* 20200420.9 (2.5.1-dev) Add hooks deliver_report and gather_reports to
* mod_dav.h.
* 20200420.10 (2.5.1-dev) Add method_precondition hook to mod_dav.h.
* 20200701.0 (2.5.1-dev) Axe ap_mpm_unregister_poll_callback and
* mpm_unregister_poll_callback hook.
*/

#define MODULE_MAGIC_COOKIE 0x41503235UL /* "AP25" */

#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20200420
#define MODULE_MAGIC_NUMBER_MAJOR 20200701
#endif
#define MODULE_MAGIC_NUMBER_MINOR 10 /* 0...n */
#define MODULE_MAGIC_NUMBER_MINOR 0 /* 0...n */

/**
* Determine if the server's current MODULE_MAGIC_NUMBER is at least a
Expand Down
10 changes: 0 additions & 10 deletions include/ap_mpm.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,6 @@ AP_DECLARE(apr_status_t) ap_mpm_register_poll_callback_timeout(
ap_mpm_callback_fn_t *tofn, void *baton, apr_time_t timeout);


/**
* Unregister a previously registered callback.
* @param pfds Array of apr_pollfd_t
* @return APR_SUCCESS if all sockets/pipes could be removed from the pollset,
* APR_ENOTIMPL if no asynch support, or an apr_pollset_remove error.
* @remark This function triggers the cleanup registered on the pool p during
* callback registration.
*/
AP_DECLARE(apr_status_t) ap_mpm_unregister_poll_callback(apr_array_header_t *pfds);

typedef enum mpm_child_status {
MPM_CHILD_STARTED,
MPM_CHILD_EXITED,
Expand Down
7 changes: 0 additions & 7 deletions include/mpm_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,6 @@ AP_DECLARE_HOOK(apr_status_t, mpm_register_poll_callback_timeout,
void *baton,
apr_time_t timeout))

/**
* Unregister the specified callback
* @ingroup hooks
*/
AP_DECLARE_HOOK(apr_status_t, mpm_unregister_poll_callback,
(apr_array_header_t *pds))

/** Resume the suspended connection
* @ingroup hooks
*/
Expand Down
45 changes: 45 additions & 0 deletions modules/proxy/mod_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1842,6 +1842,7 @@ static void *create_proxy_dir_config(apr_pool_t *p, char *dummy)
new->add_forwarded_headers_set = 0;
new->forward_100_continue = 1;
new->forward_100_continue_set = 0;
new->async_delay = -1;

return (void *) new;
}
Expand Down Expand Up @@ -1889,17 +1890,30 @@ static void *merge_proxy_dir_config(apr_pool_t *p, void *basev, void *addv)
new->error_override_set = add->error_override_set || base->error_override_set;
new->alias = (add->alias_set == 0) ? base->alias : add->alias;
new->alias_set = add->alias_set || base->alias_set;

new->add_forwarded_headers =
(add->add_forwarded_headers_set == 0) ? base->add_forwarded_headers
: add->add_forwarded_headers;
new->add_forwarded_headers_set = add->add_forwarded_headers_set
|| base->add_forwarded_headers_set;

new->forward_100_continue =
(add->forward_100_continue_set == 0) ? base->forward_100_continue
: add->forward_100_continue;
new->forward_100_continue_set = add->forward_100_continue_set
|| base->forward_100_continue_set;

new->async_delay =
(add->async_delay_set == 0) ? base->async_delay
: add->async_delay;
new->async_delay_set = add->async_delay_set
|| base->async_delay_set;
new->async_idle_timeout =
(add->async_idle_timeout_set == 0) ? base->async_idle_timeout
: add->async_idle_timeout;
new->async_idle_timeout_set = add->async_idle_timeout_set
|| base->async_idle_timeout_set;

return new;
}

Expand Down Expand Up @@ -2479,6 +2493,33 @@ static const char *
return NULL;
}

static const char *
set_proxy_async_delay(cmd_parms *parms, void *dconf, const char *arg)
{
proxy_dir_conf *conf = dconf;
if (strcmp(arg, "-1") == 0) {
conf->async_delay = -1;
}
else if (ap_timeout_parameter_parse(arg, &conf->async_delay, "s")
|| conf->async_delay < 0) {
return "ProxyAsyncDelay has wrong format";
}
conf->async_delay_set = 1;
return NULL;
}

static const char *
set_proxy_async_idle(cmd_parms *parms, void *dconf, const char *arg)
{
proxy_dir_conf *conf = dconf;
if (ap_timeout_parameter_parse(arg, &conf->async_idle_timeout, "s")
|| conf->async_idle_timeout < 0) {
return "ProxyAsyncIdleTimeout has wrong format";
}
conf->async_idle_timeout_set = 1;
return NULL;
}

static const char *
set_recv_buffer_size(cmd_parms *parms, void *dummy, const char *arg)
{
Expand Down Expand Up @@ -3068,6 +3109,10 @@ static const command_rec proxy_cmds[] =
AP_INIT_FLAG("Proxy100Continue", forward_100_continue, NULL, RSRC_CONF|ACCESS_CONF,
"on if 100-Continue should be forwarded to the origin server, off if the "
"proxy should handle it by itself"),
AP_INIT_TAKE1("ProxyAsyncDelay", set_proxy_async_delay, NULL, RSRC_CONF|ACCESS_CONF,
"Amount of time to poll before going asynchronous"),
AP_INIT_TAKE1("ProxyAsyncIdleTimeout", set_proxy_async_idle, NULL, RSRC_CONF|ACCESS_CONF,
"Timeout for asynchronous inactivity, ProxyTimeout by default"),
{NULL}
};

Expand Down
5 changes: 5 additions & 0 deletions modules/proxy/mod_proxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ typedef struct {
unsigned int forward_100_continue_set:1;

apr_array_header_t *error_override_codes;

apr_interval_time_t async_delay;
apr_interval_time_t async_idle_timeout;
unsigned int async_delay_set:1;
unsigned int async_idle_timeout_set:1;
} proxy_dir_conf;

/* if we interpolate env vars per-request, we'll need a per-request
Expand Down
Loading