mod_proxy_scgi.c revision 2792ea4d5c772a6bc19dece2e098b8125bf7184c
83fdc450aa8f79941bec84488ffd5bf8eadab18eAuke Kok/* Licensed to the Apache Software Foundation (ASF) under one or more
83fdc450aa8f79941bec84488ffd5bf8eadab18eAuke Kok * contributor license agreements. See the NOTICE file distributed with
83fdc450aa8f79941bec84488ffd5bf8eadab18eAuke Kok * this work for additional information regarding copyright ownership.
83fdc450aa8f79941bec84488ffd5bf8eadab18eAuke Kok * The ASF licenses this file to You under the Apache License, Version 2.0
83fdc450aa8f79941bec84488ffd5bf8eadab18eAuke Kok * (the "License"); you may not use this file except in compliance with
83fdc450aa8f79941bec84488ffd5bf8eadab18eAuke Kok * the License. You may obtain a copy of the License at
396f9e2b327d702ea9502b80febf836283e19350Josh Triplett * Unless required by applicable law or agreed to in writing, software
6bb25a058227d89fbbeba6c12873e6f83da5cf94William Giokas * distributed under the License is distributed on an "AS IS" BASIS,
83fdc450aa8f79941bec84488ffd5bf8eadab18eAuke Kok * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
f7900e258dfb8ab55f333d02d96f908ca0ea8899Thomas Hindoe Paaboel Andersen * See the License for the specific language governing permissions and
f7900e258dfb8ab55f333d02d96f908ca0ea8899Thomas Hindoe Paaboel Andersen * limitations under the License.
f7900e258dfb8ab55f333d02d96f908ca0ea8899Thomas Hindoe Paaboel Andersen * Proxy backend module for the SCGI protocol
f7900e258dfb8ab55f333d02d96f908ca0ea8899Thomas Hindoe Paaboel Andersen * (http://python.ca/scgi/protocol.txt)
f7900e258dfb8ab55f333d02d96f908ca0ea8899Thomas Hindoe Paaboel Andersen * Andr� Malo (nd/perlig.de), August 2007
#define APR_WANT_MEMFUNC
#define APR_WANT_STRFUNC
#include "apr_strings.h"
#include "ap_hooks.h"
#include "apr_optional_hooks.h"
#include "apr_buckets.h"
#include "httpd.h"
#include "http_config.h"
#include "http_log.h"
#include "http_protocol.h"
#include "http_request.h"
#include "util_script.h"
#include "mod_proxy.h"
const char *sendfile;
int internal_redirect;
} scgi_config;
char *buf;
apr_socket_timeout_set(p, 0);
return rv;
if (*len > 0) {
apr_bucket_heap *h;
h = a->data;
return APR_SUCCESS;
APR_BUCKET_INIT(b);
return DECLINED;
if (err) {
return HTTP_BAD_REQUEST;
r->proxyreq);
if (!path) {
return HTTP_BAD_REQUEST;
return OK;
request_rec *r)
while (length > 0) {
return HTTP_SERVICE_UNAVAILABLE;
return OK;
const char *ns_len;
+ sizeof(SCGI_MAGIC)
+ sizeof(SCGI_PROTOCOL_VERSION);
ap_add_cgi_vars(r);
if (ap_should_client_block(r)) {
int status;
while (readlen > 0) {
return HTTP_SERVICE_UNAVAILABLE;
return HTTP_INTERNAL_SERVER_ERROR;
return OK;
apr_bucket *b;
const char *location;
int status;
return status;
if (!location) {
err = 0;
if (location) {
sizeof(*req_conf));
if (err) {
req_conf);
return OK;
sizeof(*req_conf));
req_conf);
return OK;
return OK;
&proxy_scgi_module))) {
case scgi_internal_redirect:
return OK;
case scgi_sendfile:
r->output_filters);
return *status;
return OK;
return DECLINED;
int status;
char dummy;
return DECLINED;
r->server);
goto cleanup;
goto cleanup;
goto cleanup;
goto cleanup;
if (backend) {
return status;
return conf;
return conf;
const char *arg)
return NULL;
{NULL}