mod_include.c revision ffa44425004f3f2425e08ab907c67429664da02a
0N/A * Apache Software Foundation (http://www.apache.org/)."
0N/A * http_include.c: Handles the server-parsed HTML documents
0N/A#include "apr_strings.h"
0N/A#include "apr_thread_proc.h"
0N/A#include "apr_hash.h"
0N/A#include "apr_user.h"
0N/A#include "apr_optional.h"
0N/A#define APR_WANT_STRFUNC
304N/A#include "apr_want.h"
304N/A#define CORE_PRIVATE
304N/A#include "ap_config.h"
304N/A#include "util_filter.h"
304N/A#include "http_config.h"
304N/A#include "http_core.h"
304N/A#include "http_request.h"
304N/A#include "http_core.h"
304N/A#include "http_protocol.h"
304N/A#include "http_log.h"
304N/A#include "http_main.h"
304N/A#include "util_script.h"
304N/A#include "http_core.h"
304N/A#include "mod_include.h"
304N/A#include "util_ebcdic.h"
304N/A char *default_error_msg;
304N/A char *default_time_fmt;
0N/A char *default_start_tag;
0N/A char *default_end_tag;
0N/A int start_tag_len;
1909N/Astatic const char lazy_eval_sentinel;
if (r->args) {
char *val;
if (val) {
return val;
const char *var)
const char *val;
* v.s. empty strings on an empty match is deliberate.
return NULL;
return NULL;
return val;
const char *skip;
while (p < he) {
skip = p;
if (p != pi)
skip = p;
return hl;
int tagStart)
const char *buf;
*do_cleanup = 0;
int read_done = 0;
return start_bucket;
if (!read_done) {
return NULL;
c = buf;
if (len)
c = buf;
if (*c == str[0]) {
return NULL;
const char *buf;
int read_done = 0;
return dptr;
if (!read_done) {
return NULL;
c = buf;
return (tmp_buck);
if (!apr_isspace(*c)) {
if (!apr_isspace(*c)) {
if (*c == str[0]) {
return NULL;
request_rec *r,
char *tmp_buf,
int done = 0;
const char *tmp_from;
return (APR_ENOMEM);
} while ((!done) &&
return (APR_SUCCESS);
static void decodehtml(char *s)
int val, i, j;
const char *ents;
int shift_val = 0;
while (apr_islower(*c)) {
term = *c++;
*tag_val = c;
if (*c == term) {
shift_val++;
if (shift_val > 0) {
*(c-shift_val) = *c;
if (shift_val > 0) {
*(c-shift_val) = *c;
if (dodecode) {
char ch;
char *end_out;
switch (ch) {
const char *start_of_var_name;
char tmp_store;
size_t l;
++in;
++in;
++in;
if (val) {
else if (leave_name) {
next += l;
#ifdef HAVE_DRIVE_LETTERS
#ifdef NETWARE
while (*path) {
int dots = 0;
++dots;
#if defined(WIN32)
++path;
sizeof(parsed_string), 0);
int founddupe = 0;
request_rec *p;
request_rec *q;
if (p != NULL) {
if (rr)
&include_module, r);
if (!error_fmt) {
int rv;
return rc;
if (error_fmt) {
if (val) {
switch(encode) {
case E_NONE:
case E_URL:
case E_ENTITY:
r->pool);
MAX_STRING_LEN, 0);
MAX_STRING_LEN, 0);
sizeof(parsed_string), 0);
int ret=0;
if (error_fmt) {
return ret;
sizeof(parsed_string), 0);
int l, x, pos = 0;
sizeof(parsed_string), 0);
char *t_val;
int regex_error;
return (!regex_error);
enum token_type {
struct token {
char ch;
int next = 0;
char qs = 0;
int tkn_fnd = 0;
return (char *) NULL;
return (char *) NULL;
switch (ch) {
return (string);
return (string);
return (string);
return (string);
return (string);
return (string);
if (!qs) {
* but that is (IMHO) even less readable/maintainable than the goto.
if (!qs) {
switch (ch) {
if (!tkn_fnd) {
qs = 0;
if (qs) {
next = 0;
return (string);
struct parse_node {
const char *parse;
int retval = 0;
*was_error = 0;
*was_unmatched = 0;
sizeof(struct parse_node));
(char *) NULL) {
case token_string:
#ifdef DEBUG_INCLUDE
case token_string:
case token_eq:
case token_ne:
case token_and:
case token_or:
case token_lbrace:
case token_not:
case token_ge:
case token_gt:
case token_le:
case token_lt:
goto RETURN;
case token_re:
#ifdef DEBUG_INCLUDE
case token_eq:
case token_ne:
case token_and:
case token_or:
case token_lbrace:
case token_not:
goto RETURN;
case token_and:
case token_or:
#ifdef DEBUG_INCLUDE
goto RETURN;
case token_string:
case token_re:
case token_group:
case token_not:
case token_eq:
case token_ne:
case token_and:
case token_or:
case token_ge:
case token_gt:
case token_le:
case token_lt:
case token_lbrace:
goto RETURN;
case token_not:
#ifdef DEBUG_INCLUDE
case token_not:
case token_eq:
case token_ne:
case token_and:
case token_or:
case token_lbrace:
case token_ge:
case token_gt:
case token_le:
case token_lt:
goto RETURN;
case token_eq:
case token_ne:
case token_ge:
case token_gt:
case token_le:
case token_lt:
#ifdef DEBUG_INCLUDE
goto RETURN;
case token_string:
case token_re:
case token_group:
case token_lbrace:
case token_and:
case token_or:
case token_not:
case token_eq:
case token_ne:
case token_ge:
case token_gt:
case token_le:
case token_lt:
goto RETURN;
case token_rbrace:
#ifdef DEBUG_INCLUDE
goto RETURN;
case token_lbrace:
#ifdef DEBUG_INCLUDE
case token_not:
case token_eq:
case token_ne:
case token_and:
case token_or:
case token_lbrace:
case token_ge:
case token_gt:
case token_le:
case token_lt:
case token_string:
case token_re:
case token_group:
goto RETURN;
case token_string:
#ifdef DEBUG_INCLUDE
sizeof(buffer), 0);
case token_re:
goto RETURN;
case token_and:
case token_or:
#ifdef DEBUG_INCLUDE
goto RETURN;
case token_string:
case token_string:
#ifdef DEBUG_INCLUDE
#ifdef DEBUG_INCLUDE
case token_eq:
case token_ne:
#ifdef DEBUG_INCLUDE
goto RETURN;
#ifdef DEBUG_INCLUDE
#ifdef DEBUG_INCLUDE
#ifdef DEBUG_INCLUDE
case token_ge:
case token_gt:
case token_le:
case token_lt:
#ifdef DEBUG_INCLUDE
goto RETURN;
#ifdef DEBUG_INCLUDE
#ifdef DEBUG_INCLUDE
case token_not:
#ifdef DEBUG_INCLUDE
case token_group:
#ifdef DEBUG_INCLUDE
case token_lbrace:
goto RETURN;
case token_rbrace:
goto RETURN;
goto RETURN;
return (retval);
#ifdef DEBUG_INCLUDE
r->filename);
if (was_error) {
if (was_unmatched) {
if (expr_ret) {
#ifdef DEBUG_INCLUDE
r->filename);
r->filename);
if (was_error) {
if (was_unmatched) {
if (expr_ret) {
#ifdef DEBUG_INCLUDE
r->filename);
r->filename);
sizeof(parsed_string), 0);
*next = 0;
r->pool);
r->filename);
int do_cleanup = 0;
return rv;
return rv;
apr_bucket **);
r->filename);
return APR_SUCCESS;
return (rv);
return rv;
return rv;
return APR_SUCCESS;
return result;
return result;
return NULL;
request_rec *r = f->r;
if (!f->ctx) {
ap_add_cgi_vars(r);
/* Always unset the ETag/Last-Modified fields - see RFC2616 - 13.3.4.
return send_parsed_content(&b, r, f);
if(ssi_pfn_register) {
return OK;
return NULL;
return NULL;
return NULL;
return NULL;
{NULL}
return DECLINED;
return DECLINED;
return DECLINED;
return DECLINED;
return DECLINED;