mod_proxy_fcgi.c revision 820e91baab4f9a45001d668698d2fae3501cb4b0
c79e39ad568d9af854765f64049534044ef6c034nd/* Licensed to the Apache Software Foundation (ASF) under one or more
2d0611ffc9f91c5fc2ddccb93f9a3d17791ae650takashi * contributor license agreements. See the NOTICE file distributed with
c79e39ad568d9af854765f64049534044ef6c034nd * this work for additional information regarding copyright ownership.
d3e250aab242db84d14060985b5db675a731d548nd * The ASF licenses this file to You under the Apache License, Version 2.0
c79e39ad568d9af854765f64049534044ef6c034nd * (the "License"); you may not use this file except in compliance with
c79e39ad568d9af854765f64049534044ef6c034nd * the License. You may obtain a copy of the License at
c79e39ad568d9af854765f64049534044ef6c034nd * Unless required by applicable law or agreed to in writing, software
c79e39ad568d9af854765f64049534044ef6c034nd * distributed under the License is distributed on an "AS IS" BASIS,
c79e39ad568d9af854765f64049534044ef6c034nd * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#include "mod_proxy.h"
#include "fcgi_protocol.h"
#include "util_script.h"
return DECLINED;
if (err) {
return HTTP_BAD_REQUEST;
r->proxyreq);
return HTTP_BAD_REQUEST;
return OK;
unsigned char type,
unsigned char padding_len)
int nvec,
int blocking)
int i, offset;
if (!blocking) {
return arv;
return arv;
for (i = 0; i < nvec; i++) {
offset = 0;
while (to_write) {
apr_size_t n = 0;
written += n;
offset++;
if (!blocking) {
return arv;
return rv;
char *buffer,
return rv;
int request_id)
int i, numenv;
ap_add_cgi_vars(r);
#ifdef FCGI_DUMP_ENV_VARS
(int)bodylen, i);
numenv = i;
for (i = 0; i < numenv; ++i) {
if (rv) {
return rv;
int *state,
char *readbuf,
while (*itr) {
switch (*state) {
case HDR_STATE_GOT_CRLF:
switch (*state) {
case HDR_STATE_GOT_LF:
case HDR_STATE_GOT_CR:
case HDR_STATE_GOT_CRLFCR:
++itr;
apr_bucket *b;
#ifdef FCGI_DUMP_HEADERS
if (isprint(c)) {
asc_line[i] = c;
posn++;
int request_id)
while (! done) {
int last_stdin = 0;
sizeof(writebuf));
if (last_stdin) {
apr_bucket *b;
char plen;
if (readbuflen != 0) {
switch (type) {
case FCGI_STDOUT:
if (clen != 0) {
c->bucket_alloc);
if (! seen_end_of_headers) {
goto recv_again;
case FCGI_STDERR:
if (clen) {
goto recv_again;
case FCGI_END_REQUEST:
if (plen) {
return rv;
return HTTP_SERVICE_UNAVAILABLE;
return HTTP_SERVICE_UNAVAILABLE;
return HTTP_SERVICE_UNAVAILABLE;
return OK;
int status;
&proxy_module);
return DECLINED;
if (! backend) {
r->server);
if (backend) {
return status;
sizeof(server_portstr));
goto cleanup;
goto cleanup;
return status;