mod_include.c revision 4ef58e49c51f8683c0e3a540a34afb0a22e45366
1010N/A * Apache Software Foundation (http://www.apache.org/)."
* http_include.c: Handles the server-parsed HTML documents
#include "apr.h"
#include "apr_strings.h"
#include "apr_thread_proc.h"
#include "apr_hash.h"
#include "apr_user.h"
#include "apr_lib.h"
#include "apr_optional.h"
#define APR_WANT_STRFUNC
#include "apr_want.h"
#define CORE_PRIVATE
#include "ap_config.h"
#include "util_filter.h"
#include "httpd.h"
#include "http_config.h"
#include "http_core.h"
#include "http_request.h"
#include "http_core.h"
#include "http_protocol.h"
#include "http_log.h"
#include "http_main.h"
#include "util_script.h"
#include "http_core.h"
#include "mod_include.h"
#include "util_ebcdic.h"
enum xbithack {
struct bndm_t {
char *default_error_msg;
char *default_time_fmt;
char *default_start_tag;
char *default_end_tag;
int start_tag_len;
char *undefinedEcho;
int undefinedEchoLen;
#ifdef XBITHACK
static 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;
const char *start;
int read_done = 0;
return dptr;
if (!read_done) {
return NULL;
c = buf;
start = c;
return (tmp_buck);
if (!apr_isspace(*c)) {
const char *tmp = c;
*c != *str);
if (!apr_isspace(*c)) {
const char *tmp = 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 (!term) {
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 *next;
char *end_out;
if (!out) {
switch (ch) {
char *new_out;
return out;
const char *start_of_var_name;
char tmp_store;
size_t l;
++in;
return out;
++in;
++in;
if (val) {
else if (leave_name) {
char *new_out;
next += l;
char *new_out;
return out;
return out;
#ifdef HAVE_DRIVE_LETTERS
#ifdef NETWARE
while (*path) {
int dots = 0;
++dots;
#if defined(WIN32)
char *parsed_string;
return rc;
MAX_STRING_LEN, 0);
int founddupe = 0;
request_rec *p;
request_rec *q;
if (p != NULL) {
if (rr)
&include_module, r);
if (error_fmt) {
const char *val =
MAX_STRING_LEN, 0));
if (val) {
switch(encode) {
case E_NONE:
case E_URL:
case E_ENTITY:
r->pool);
r->pool);
char *parsed_string;
MAX_STRING_LEN, 0);
MAX_STRING_LEN, 0);
MAX_STRING_LEN, 0);
int ret=0;
if (error_fmt) {
return ret;
char *parsed_string;
MAX_STRING_LEN, 0);
int l, x, pos = 0;
char *parsed_string;
MAX_STRING_LEN, 0);
char *t_val;
int regex_error;
return (!regex_error);
enum token_type {
struct token {
char* value;
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) {
if (!qs) {
switch (ch) {
if (!tkn_fnd) {
qs = 0;
if (qs) {
next = 0;
return (string);
struct parse_node {
const char *parse;
char* buffer;
int retval = 0;
*was_error = 0;
*was_unmatched = 0;
sizeof(struct parse_node));
(char *) NULL) {
case token_string:
#ifdef DEBUG_INCLUDE
case token_string:
NULL);
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:
return retval;
case token_re:
#ifdef DEBUG_INCLUDE
case token_eq:
case token_ne:
case token_and:
case token_or:
case token_lbrace:
case token_not:
return retval;
case token_and:
case token_or:
#ifdef DEBUG_INCLUDE
return retval;
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:
return retval;
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:
return retval;
case token_eq:
case token_ne:
case token_ge:
case token_gt:
case token_le:
case token_lt:
#ifdef DEBUG_INCLUDE
return retval;
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:
return retval;
case token_rbrace:
#ifdef DEBUG_INCLUDE
return retval;
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:
return retval;
case token_string:
#ifdef DEBUG_INCLUDE
MAX_STRING_LEN, 0);
case token_re:
return retval;
case token_and:
case token_or:
#ifdef DEBUG_INCLUDE
return retval;
case token_string:
case token_string:
#ifdef DEBUG_INCLUDE
#ifdef DEBUG_INCLUDE
case token_eq:
case token_ne:
#ifdef DEBUG_INCLUDE
return retval;
#ifdef DEBUG_INCLUDE
#ifdef DEBUG_INCLUDE
#ifdef DEBUG_INCLUDE
case token_ge:
case token_gt:
case token_le:
case token_lt:
#ifdef DEBUG_INCLUDE
return retval;
#ifdef DEBUG_INCLUDE
#ifdef DEBUG_INCLUDE
case token_not:
#ifdef DEBUG_INCLUDE
case token_group:
#ifdef DEBUG_INCLUDE
case token_lbrace:
return retval;
case token_rbrace:
return retval;
return retval;
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);
char *parsed_string;
while (sub) {
MAX_STRING_LEN, 0);
r->filename);
MAX_STRING_LEN, 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;
return NULL;
{NULL}
return DECLINED;
return DECLINED;
return DECLINED;
return DECLINED;
return DECLINED;