mod_test_util_uri.c revision 72360798a27566f28e2cbee0e39a0a6e3c3bd729
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal/* ====================================================================
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * The Apache Software License, Version 1.1
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * Copyright (c) 2000-2001 The Apache Software Foundation. All rights
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * Redistribution and use in source and binary forms, with or without
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * modification, are permitted provided that the following conditions
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * 1. Redistributions of source code must retain the above copyright
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * notice, this list of conditions and the following disclaimer.
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * 2. Redistributions in binary form must reproduce the above copyright
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * notice, this list of conditions and the following disclaimer in
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * the documentation and/or other materials provided with the
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * distribution.
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * 3. The end-user documentation included with the redistribution,
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * if any, must include the following acknowledgment:
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * "This product includes software developed by the
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * Apache Software Foundation (http://www.apache.org/)."
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * Alternately, this acknowledgment may appear in the software itself,
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * if and wherever such third-party acknowledgments normally appear.
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * 4. The names "Apache" and "Apache Software Foundation" must
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * not be used to endorse or promote products derived from this
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * software without prior written permission. For written
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * permission, please contact apache@apache.org.
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * 5. Products derived from this software may not be called "Apache",
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * nor may "Apache" appear in their name, without prior written
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * permission of the Apache Software Foundation.
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9c5813a11a03405103e51aae43b1a333703e123cDipu Seminlal * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
#include "httpd.h"
#include "http_protocol.h"
#include "http_config.h"
#include "http_main.h"
const char *scheme;
const char *user;
const char *password;
const char *hostname;
const char *port_str;
const char *path;
const char *query;
const char *fragment;
} test_uri_t;
{ "http", "userid", "passwd", "hostname.goes.here", "80", "/path/goes/here", "query-here", "frag-here" },
{ "http", "userid", "passwd", "hostname.goes.here", "", "/path/goes/here", "query-here", "frag-here" },
* http://hostname HTTP/1.1". So this is why parse_uri_components returns
{ "https", "user@d", "pa:swd", "hostname.goes.here.", "", "/~path/goes/here", "query&query?crud", "frag-here?baby" }
static char *my_stpcpy(char *d, const char *s)
char *input_uri;
char *strp;
unsigned expect;
int status;
unsigned failures;
failures = 0;
for (u = 0; u < T_MAX; ++u) {
expect = 0;
if (u & T_password) {
if (u & T_port_str) {
if (u & T_path) {
if (u & T_query) {
if (u & T_fragment) {
*strp = 0;
#define CHECK(f) \
ap_rprintf(r, "<tr><td>%d</td><td>0x%02x</td><td>0x%02x</td><td>%d</td><td>\"%s\"</td>", row, u, expect, status, input_uri);
#define DUMP(f) \
if (result.f) { \
++failures;
return failures;
unsigned total_failures;
return DECLINED;
if(r->header_only) {
if (r->args) {
total_failures = 0;
return OK;
return OK;
{NULL}