23 #define APR_WANT_STRFUNC
24 #define APR_WANT_MEMFUNC
74 "%sstderr from %s: %s", logno ? logno :
"",
r->
filename, error);
112 newline = strchr(argsbuffer,
'\n');
114 char *
prev = newline - 1;
115 if (
prev >= argsbuffer && *
prev ==
'\r') {
131 char *tag_val = NULL;
141 "missing argument for exec element in %s",
r->
filename);
162 if (!tag || !tag_val) {
166 if (!strcmp(tag,
"cmd")) {
169 cgi_pfn_ps(ctx, tag_val, parsed_string,
sizeof(parsed_string),
172 rv = include_cmd(ctx, f,
bb, parsed_string);
175 "for parameter \"%s\" to tag exec in file %s",
181 else if (!strcmp(tag,
"cgi")) {
184 cgi_pfn_ps(ctx, tag_val, parsed_string,
sizeof(parsed_string),
187 rv = include_cgi(ctx, f,
bb, parsed_string);
190 "\"%s\" in %s", tag_val, file);
197 "\"%s\" to tag exec in %s", tag, file);
207 static void cgi_optfns_retrieve(
void)
215 if (cgi_pfn_reg_with_ssi && cgi_pfn_gtv && cgi_pfn_ps) {
219 cgi_pfn_reg_with_ssi(
"exec", cgi_handle_exec);
223 #ifdef WANT_CGI_BUCKET
228 struct cgi_bucket_data {
253 b->
type = &bucket_type_cgi;
261 "apr_pollset_create(); check system or user limits");
273 "apr_pollset_add(); check system or user limits");
282 "apr_pollset_add(); check system or user limits");
287 data->timeout = timeout;
293 static apr_bucket *cgi_bucket_dup(
struct cgi_bucket_data *data,
300 b->
type = &bucket_type_cgi;
327 struct cgi_bucket_data *data = a->
data;
350 struct cgi_bucket_data *data = b->
data;
356 timeout = data->timeout > 0 ? data->timeout : data->r->server->timeout;
367 "Timeout waiting for output from CGI script %s",
380 "poll failed waiting for CGI child");
384 for (; num; num--, results++) {
385 if (results[0].client_data == (
void *)1) {
387 rv = cgi_read_stdout(b, results[0].
desc.f,
str, len);
394 apr_status_t rv2 = log_script_err(data->r, results[0].desc.f);
407 "CGI", 5, APR_BUCKET_DATA,
427 const char *location;
441 ret = log_script(
r,
conf, ret, logdata, sbuf,
bb, script_err);
473 if (location &&
r->
status == 200) {
477 discard_script_output(
bb);
482 log_script_err(
r, script_err);
486 if (location && location[0] ==
'/' &&
r->
status == 200) {
502 else if (location &&
r->
status == 200) {
506 discard_script_output(
bb);
539 log_script_err(
r, script_err);
555 int child_stopped_reading = 0;
587 if (child_stopped_reading) {
597 if (logbufbytes && dbpos < logbufbytes) {
600 if ((dbpos + len) > logbufbytes) {
601 cursize = logbufbytes - dbpos;
606 memcpy(logbuf + dbpos, data, cursize);
617 child_stopped_reading = 1;
619 "Error writing request body to script %s",
628 logbuf[dbpos] =
'\0';
APR Platform Definitions.
APR-UTIL Buckets/Bucket Brigades.
APR general purpose library routines.
APR Standard Headers Support.
void * ap_get_module_config(const ap_conf_vector_t *cv, const module *m)
#define HUGE_STRING_LEN
Definition: httpd.h:308
#define MAX_STRING_LEN
Definition: httpd.h:305
#define OK
Definition: httpd.h:461
apr_status_t ap_pass_brigade(ap_filter_t *filter, apr_bucket_brigade *bucket)
apr_status_t ap_get_brigade(ap_filter_t *filter, apr_bucket_brigade *bucket, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes)
@ AP_FTYPE_CONNECTION
Definition: util_filter.h:180
#define APLOGNO(n)
Definition: http_log.h:117
#define APLOG_ERR
Definition: http_log.h:46
#define APLOG_MARK
Definition: http_log.h:283
#define APLOG_WARNING
Definition: http_log.h:47
void ap_log_rerror(const char *file, int line, int module_index, int level, apr_status_t status, const request_rec *r, const char *fmt,...)
#define APLOG_MODULE_INDEX
Definition: http_log.h:168
void ap_internal_redirect_handler(const char *new_uri, request_rec *r)
int ap_scan_script_header_err_brigade_ex(request_rec *r, apr_bucket_brigade *bb, char *buffer, int module_index)
int status
Definition: httpd.h:902
ap_conn_keepalive_e keepalive
Definition: httpd.h:1261
char * uri
Definition: httpd.h:1027
struct ap_filter_t * output_filters
Definition: httpd.h:1081
int method_number
Definition: httpd.h:909
apr_pool_t * pool
Definition: httpd.h:858
char * filename
Definition: httpd.h:1029
conn_rec * connection
Definition: httpd.h:860
struct ap_filter_t * proto_output_filters
Definition: httpd.h:1087
struct ap_filter_t * input_filters
Definition: httpd.h:1083
apr_table_t * headers_in
Definition: httpd.h:987
struct ap_conf_vector_t * module_config
Definition: httpd.h:1405
const char * protocol
Definition: httpd.h:890
server_rec * server
Definition: httpd.h:862
const char * method
Definition: httpd.h:911
unsigned aborted
Definition: httpd.h:1257
char * args
Definition: httpd.h:1037
apr_table_t * headers_out
Definition: httpd.h:989
#define APR_EAGAIN
Definition: apr_errno.h:736
#define APR_EOF
Definition: apr_errno.h:467
#define APR_STATUS_IS_EINTR(s)
Definition: apr_errno.h:1295
#define APR_STATUS_IS_TIMEUP(s)
Definition: apr_errno.h:540
#define APR_STATUS_IS_EOF(s)
Definition: apr_errno.h:573
#define APR_BUCKET_INIT(e)
Definition: apr_buckets.h:448
void apr_bucket_destroy_noop(void *data)
#define APR_BUCKET_INSERT_AFTER(a, b)
Definition: apr_buckets.h:419
#define APR_BUCKET_IS_FLUSH(e)
Definition: apr_buckets.h:463
apr_status_t apr_bucket_split_notimpl(apr_bucket *data, apr_size_t point)
apr_status_t apr_bucket_copy_notimpl(apr_bucket *e, apr_bucket **c)
#define APR_BUCKET_NEXT(e)
Definition: apr_buckets.h:430
apr_read_type_e
Definition: apr_buckets.h:62
apr_bucket_brigade apr_status_t apr_brigade_destroy(apr_bucket_brigade *b) __attribute__((nonnull(1)))
#define APR_BUCKET_BUFF_SIZE
Definition: apr_buckets.h:54
#define APR_BRIGADE_SENTINEL(b)
Definition: apr_buckets.h:339
#define apr_bucket_delete(e)
Definition: apr_buckets.h:1086
#define APR_BUCKET_IS_EOS(e)
Definition: apr_buckets.h:469
void apr_bucket_free(void *block) __attribute__((nonnull(1)))
void * apr_bucket_alloc(apr_size_t size, apr_bucket_alloc_t *list) __attribute__((nonnull(2)))
struct apr_bucket_alloc_t apr_bucket_alloc_t
Definition: apr_buckets.h:128
#define APR_BRIGADE_FIRST(b)
Definition: apr_buckets.h:353
apr_bucket apr_bucket apr_bucket apr_bucket apr_bucket apr_bucket * apr_bucket_heap_make(apr_bucket *b, const char *buf, apr_size_t nbyte, void(*free_func)(void *data)) __attribute__((nonnull(1
apr_bucket apr_bucket * apr_bucket_immortal_make(apr_bucket *b, const char *buf, apr_size_t nbyte) __attribute__((nonnull(1
apr_status_t apr_bucket_setaside_notimpl(apr_bucket *data, apr_pool_t *pool)
#define apr_bucket_read(e, str, len, block)
Definition: apr_buckets.h:1159
apr_status_t apr_brigade_cleanup(void *data) __attribute__((nonnull(1)))
@ APR_BLOCK_READ
Definition: apr_buckets.h:63
@ APR_NONBLOCK_READ
Definition: apr_buckets.h:64
#define APR_RETRIEVE_OPTIONAL_FN(name)
Definition: apr_optional.h:84
#define APR_OPTIONAL_FN_TYPE(name)
Definition: apr_optional.h:42
#define HTTP_NOT_MODIFIED
Definition: httpd.h:509
#define HTTP_MOVED_TEMPORARILY
Definition: httpd.h:507
#define HTTP_GATEWAY_TIME_OUT
Definition: httpd.h:546
int int apr_status_t const char * desc
Definition: mod_dav.h:143
request_rec * r
Definition: mod_dav.h:518
dav_buffer const char * str
Definition: mod_dav.h:465
apr_bucket_brigade * bb
Definition: mod_dav.h:555
const char * s
Definition: mod_dav.h:1327
int int const char dav_error * prev
Definition: mod_dav.h:171
dav_error * err
Definition: mod_dav.h:203
apr_bucket_brigade ap_input_mode_t apr_read_type_e block
Definition: mod_dav.h:2663
#define SSI_FLAG_PRINTING
Definition: mod_include.h:56
#define SSI_EXPAND_LEAVE_NAME
Definition: mod_include.h:41
void ap_register_include_handler(char *tag, include_handler_fn_t *func)
#define SSI_EXPAND_DROP_NAME
Definition: mod_include.h:42
char * ap_ssi_parse_string(include_ctx_t *ctx, const char *in, char *out, apr_size_t length, int leave_name)
#define SSI_CREATE_ERROR_BUCKET(ctx, f, bb)
Definition: mod_include.h:48
#define SSI_VALUE_DECODED
Definition: mod_include.h:35
void ap_ssi_get_tag_and_value(include_ctx_t *ctx, char **tag, char **tag_val, int dodecode)
#define SSI_FLAG_NO_EXEC
Definition: mod_include.h:59
proxy_worker proxy_server_conf * conf
Definition: mod_proxy.h:657
#define M_GET
Definition: httpd.h:599
@ AP_CONN_CLOSE
Definition: httpd.h:1183
#define APR_SUCCESS
Definition: apr_errno.h:225
int apr_status_t
Definition: apr_errno.h:44
apr_status_t apr_file_close(apr_file_t *file)
apr_status_t apr_file_write_full(apr_file_t *thefile, const void *buf, apr_size_t nbytes, apr_size_t *bytes_written)
apr_status_t apr_file_open(apr_file_t **newf, const char *fname, apr_int32_t flag, apr_fileperms_t perm, apr_pool_t *pool)
int apr_file_printf(apr_file_t *fptr, const char *format,...) __attribute__((format(printf
apr_status_t apr_file_read(apr_file_t *thefile, void *buf, apr_size_t *nbytes)
apr_status_t apr_file_pipe_timeout_set(apr_file_t *thepipe, apr_interval_time_t timeout)
apr_status_t apr_file_gets(char *str, int len, apr_file_t *thefile)
#define APR_APPEND
Definition: apr_file_io.h:103
#define APR_WRITE
Definition: apr_file_io.h:101
#define APR_CREATE
Definition: apr_file_io.h:102
#define APR_OS_DEFAULT
Definition: apr_file_info.h:112
#define APR_FINFO_SIZE
Definition: apr_file_info.h:149
apr_status_t apr_stat(apr_finfo_t *finfo, const char *fname, apr_int32_t wanted, apr_pool_t *pool)
apr_status_t apr_pollset_remove(apr_pollset_t *pollset, const apr_pollfd_t *descriptor)
apr_status_t apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p, apr_uint32_t flags)
apr_status_t apr_pollset_add(apr_pollset_t *pollset, const apr_pollfd_t *descriptor)
apr_status_t apr_pollset_poll(apr_pollset_t *pollset, apr_interval_time_t timeout, apr_int32_t *num, const apr_pollfd_t **descriptors)
@ APR_POLL_FILE
Definition: apr_poll.h:95
void * apr_palloc(apr_pool_t *p, apr_size_t size) __attribute__((nonnull(1)))
const char * apr_table_get(const apr_table_t *t, const char *key)
void apr_table_unset(apr_table_t *t, const char *key)
#define APR_CTIME_LEN
Definition: apr_time.h:198
apr_int64_t apr_interval_time_t
Definition: apr_time.h:55
apr_time_t apr_time_now(void)
apr_status_t apr_ctime(char *date_str, apr_time_t t)
#define APR_POLLIN
Definition: apr_poll.h:49
ap_filter_type ftype
Definition: util_filter.h:254
The representation of a filter chain.
Definition: util_filter.h:278
request_rec * r
Definition: util_filter.h:294
ap_filter_rec_t * frec
Definition: util_filter.h:282
ap_filter_t * next
Definition: util_filter.h:288
Definition: apr_buckets.h:263
Definition: apr_buckets.h:551
apr_size_t alloc_len
Definition: apr_buckets.h:559
Definition: apr_buckets.h:136
Definition: apr_buckets.h:229
apr_size_t length
Definition: apr_buckets.h:239
void(* free)(void *e)
Definition: apr_buckets.h:257
apr_off_t start
Definition: apr_buckets.h:247
apr_bucket_alloc_t * list
Definition: apr_buckets.h:259
void * data
Definition: apr_buckets.h:249
const apr_bucket_type_t * type
Definition: apr_buckets.h:233
Definition: apr_arch_file_io.h:107
Definition: apr_file_info.h:174
apr_off_t size
Definition: apr_file_info.h:198
Definition: apr_poll.h:109
void * client_data
Definition: apr_poll.h:115
apr_int16_t reqevents
Definition: apr_poll.h:112
apr_datatype_e desc_type
Definition: apr_poll.h:111
apr_descriptor desc
Definition: apr_poll.h:114
apr_pool_t * p
Definition: apr_poll.h:110
Definition: apr_arch_poll_private.h:124
Definition: mod_include.h:69
int flags
Definition: mod_include.h:77
unsigned argc
Definition: mod_include.h:89
A structure that represents the current request.
Definition: httpd.h:856
apr_file_t * f
Definition: apr_poll.h:101
@ AP_MODE_READBYTES
Definition: util_filter.h:43