mod_include.c revision 7c19ce86bbd72bba1d018522250f5f315ffbc0af
c79e39ad568d9af854765f64049534044ef6c034nd/* ====================================================================
c79e39ad568d9af854765f64049534044ef6c034nd * The Apache Software License, Version 1.1
c79e39ad568d9af854765f64049534044ef6c034nd * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
c79e39ad568d9af854765f64049534044ef6c034nd * reserved.
c79e39ad568d9af854765f64049534044ef6c034nd * Redistribution and use in source and binary forms, with or without
c79e39ad568d9af854765f64049534044ef6c034nd * modification, are permitted provided that the following conditions
c79e39ad568d9af854765f64049534044ef6c034nd * are met:
c79e39ad568d9af854765f64049534044ef6c034nd * 1. Redistributions of source code must retain the above copyright
c79e39ad568d9af854765f64049534044ef6c034nd * notice, this list of conditions and the following disclaimer.
* 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 {
char *default_error_msg;
char *default_time_fmt;
#ifdef XBITHACK
static char lazy_eval_sentinel;
if (r->args) {
char *val;
if (val) {
return val;
const char *buf;
*do_cleanup = 0;
int read_done = 0;
return start_bucket;
if (!read_done) {
return NULL;
c = buf;
if (*c == str[0]) {
return NULL;
const char *buf;
int read_done = 0;
return dptr;
if (!read_done) {
return NULL;
c = buf;
if (!apr_isspace(*c)) {
if (!apr_isspace(*c)) {
if ((c - buf) > 0) {
return (tmp_buck);
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;
*tag_val = c;
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;
int founddupe = 0;
request_rec *p;
request_rec *q;
if (p != NULL) {
if (rr)
if (!error_fmt) {
int rv;
return rc;
if (error_fmt) {
!= NESTED_INCLUDE_MAGIC) {
if (val) {
switch(encode) {
case E_NONE:
case E_URL:
case E_ENTITY:
int ret=0;
if (error_fmt) {
return ret;
int l, x, pos = 0;
char *t_val;
int regex_error;
return (!regex_error);
enum token_type {
struct token {
int *unmatched)
char ch;
int next = 0;
int 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;
++string;
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));
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_and:
case token_or:
#ifdef DEBUG_INCLUDE
goto RETURN;
case token_string:
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_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_group:
goto RETURN;
case token_string:
#ifdef DEBUG_INCLUDE
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;
int len;
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
if (was_error) {
if (was_unmatched) {
if (expr_ret) {
#ifdef DEBUG_INCLUDE
if (was_error) {
if (was_unmatched) {
if (expr_ret) {
#ifdef DEBUG_INCLUDE
r->filename);
val_text =
int do_cleanup = 0;
return rv;
return rv;
r->filename);
return APR_SUCCESS;
return (rv);
return rv;
return rv;
return APR_SUCCESS;
return result;
return NULL;
request_rec *r = f->r;
if (!f->ctx) {
ap_add_cgi_vars(r);
if (parent) {
return rv;
if(ssi_pfn_register) {
return NULL;
return NULL;
{NULL}
return DECLINED;
return DECLINED;
return DECLINED;
return DECLINED;
return DECLINED;