Apache HTTPD
mod_proxy_scgi.c
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17/*
18 * mod_proxy_scgi.c
19 * Proxy backend module for the SCGI protocol
20 * (http://python.ca/scgi/protocol.txt)
21 *
22 * Andr� Malo (nd/perlig.de), August 2007
23 */
24
25#define APR_WANT_MEMFUNC
26#define APR_WANT_STRFUNC
27#include "apr_strings.h"
28#include "ap_hooks.h"
29#include "apr_optional_hooks.h"
30#include "apr_buckets.h"
31
32#include "httpd.h"
33#include "http_config.h"
34#include "http_log.h"
35#include "http_protocol.h"
36#include "http_request.h"
37#include "util_script.h"
38
39#include "mod_proxy.h"
40#include "scgi.h"
41
42
43#define SCHEME "scgi"
44#define PROXY_FUNCTION "SCGI"
45#define SCGI_MAGIC "SCGI"
46#define SCGI_PROTOCOL_VERSION "1"
47
48/* just protect from typos */
49#define CONTENT_LENGTH "CONTENT_LENGTH"
50#define GATEWAY_INTERFACE "GATEWAY_INTERFACE"
51
52module AP_MODULE_DECLARE_DATA proxy_scgi_module;
53
54
59
60typedef struct {
61 const char *location; /* target URL */
62 scgi_request_type type; /* type of request */
64
65const char *scgi_sendfile_off = "off";
66const char *scgi_sendfile_on = "X-Sendfile";
67const char *scgi_internal_redirect_off = "off";
68const char *scgi_internal_redirect_on = "Location";
69
70typedef struct {
71 const char *sendfile;
72 const char *internal_redirect;
74
75
76/*
77 * We create our own bucket type, which is actually derived (c&p) from the
78 * socket bucket.
79 * Maybe some time this should be made more abstract (like passing an
80 * interception function to read or something) and go into the ap_ or
81 * even apr_ namespace.
82 */
83
88
91
92
96{
98 apr_socket_t *p = data->sock;
99 char *buf;
100 apr_status_t rv;
102
103 if (block == APR_NONBLOCK_READ) {
106 }
107
108 *str = NULL;
111
112 rv = apr_socket_recv(p, buf, len);
113
114 if (block == APR_NONBLOCK_READ) {
116 }
117
118 if (rv != APR_SUCCESS && rv != APR_EOF) {
120 return rv;
121 }
122
123 if (*len > 0) {
125
126 /* count for stats */
127 *data->counter += *len;
128
129 /* Change the current bucket to refer to what we read */
131 h = a->data;
132 h->alloc_len = APR_BUCKET_BUFF_SIZE; /* note the real buffer size */
133 *str = buf;
135 }
136 else {
138 a = apr_bucket_immortal_make(a, "", 0);
139 *str = a->data;
140 }
141 return APR_SUCCESS;
142}
143
152
154{
155 b->type = &bucket_type_socket_ex;
156 b->length = (apr_size_t)(-1);
157 b->start = -1;
158 b->data = data;
159 return b;
160}
161
164{
165 apr_bucket *b = apr_bucket_alloc(sizeof(*b), list);
166
168 b->free = apr_bucket_free;
169 b->list = list;
171}
172
173
174/*
175 * Canonicalize scgi-like URLs.
176 */
177static int scgi_canon(request_rec *r, char *url)
178{
179 char *host, sport[sizeof(":65535")];
180 const char *err, *path;
183 int flags = d->allow_encoded_slashes && !d->decode_encoded_slashes ? PROXY_CANONENC_NOENCODEDSLASHENCODING : 0;
184
185 if (ap_cstr_casecmpn(url, SCHEME "://", sizeof(SCHEME) + 2)) {
186 return DECLINED;
187 }
188 url += sizeof(SCHEME); /* Keep slashes */
189
191
193 if (err) {
195 "error parsing URL %s: %s", url, err);
196 return HTTP_BAD_REQUEST;
197 }
198
199 if (port != def_port) {
200 apr_snprintf(sport, sizeof(sport), ":%u", port);
201 }
202 else {
203 sport[0] = '\0';
204 }
205
206 if (ap_strchr(host, ':')) { /* if literal IPv6 address */
207 host = apr_pstrcat(r->pool, "[", host, "]", NULL);
208 }
209
211 r->proxyreq);
212 if (!path) {
213 return HTTP_BAD_REQUEST;
214 }
215
216 r->filename = apr_pstrcat(r->pool, "proxy:" SCHEME "://", host, sport, "/",
217 path, NULL);
218
219 if (apr_table_get(r->subprocess_env, "proxy-scgi-pathinfo")) {
220 r->path_info = apr_pstrcat(r->pool, "/", path, NULL);
221 }
222
223 return OK;
224}
225
226
227/*
228 * Send a block of data, ensure, everything is sent
229 */
230static int sendall(proxy_conn_rec *conn, const char *buf, apr_size_t length,
231 request_rec *r)
232{
233 apr_status_t rv;
234 apr_size_t written;
235
236 while (length > 0) {
237 written = length;
238 if ((rv = apr_socket_send(conn->sock, buf, &written)) != APR_SUCCESS) {
240 "sending data to %s:%u failed",
241 conn->hostname, conn->port);
243 }
244
245 /* count for stats */
246 conn->worker->s->transferred += written;
247 buf += written;
248 length -= written;
249 }
250
251 return OK;
252}
253
254
255/*
256 * Send SCGI header block
257 */
259{
260 char *buf, *cp, *bodylen;
261 const char *ns_len;
263 const apr_table_entry_t *env;
264 int j;
267 + sizeof(SCGI_MAGIC)
268 + sizeof(SCGI_PROTOCOL_VERSION);
269
272
273 /*
274 * The header blob basically takes the environment and concatenates
275 * keys and values using 0 bytes. There are special treatments here:
276 * - GATEWAY_INTERFACE and SCGI_MAGIC are dropped
277 * - CONTENT_LENGTH is always set and must be sent as the very first
278 * variable
279 *
280 * Additionally it's wrapped into a so-called netstring (see SCGI spec)
281 */
284 for (j = 0; j < env_table->nelts; ++j) {
285 if ( (!strcmp(env[j].key, GATEWAY_INTERFACE))
286 || (!strcmp(env[j].key, CONTENT_LENGTH))
287 || (!strcmp(env[j].key, SCGI_MAGIC))) {
288 continue;
289 }
290 headerlen += strlen(env[j].key) + strlen(env[j].val) + 2;
291 }
293 bodylen_size = strlen(bodylen) + 1;
295
297 len = strlen(ns_len);
298 headerlen += len + 1; /* 1 == , */
299 cp = buf = apr_palloc(r->pool, headerlen);
300 memcpy(cp, ns_len, len);
301 cp += len;
302
304 cp += sizeof(CONTENT_LENGTH);
306 cp += bodylen_size;
307 memcpy(cp, SCGI_MAGIC, sizeof(SCGI_MAGIC));
308 cp += sizeof(SCGI_MAGIC);
310 cp += sizeof(SCGI_PROTOCOL_VERSION);
311
312 for (j = 0; j < env_table->nelts; ++j) {
313 if ( (!strcmp(env[j].key, GATEWAY_INTERFACE))
314 || (!strcmp(env[j].key, CONTENT_LENGTH))
315 || (!strcmp(env[j].key, SCGI_MAGIC))) {
316 continue;
317 }
318 len = strlen(env[j].key) + 1;
319 memcpy(cp, env[j].key, len);
320 cp += len;
321 len = strlen(env[j].val) + 1;
322 memcpy(cp, env[j].val, len);
323 cp += len;
324 }
325 *cp++ = ',';
326
327 return sendall(conn, buf, headerlen, r);
328}
329
330
331/*
332 * Send request body (if any)
333 */
335{
337 char *buf = apr_palloc(r->pool, AP_IOBUFSIZE);
338 int status;
339 long readlen;
340
342 while (readlen > 0) {
343 status = sendall(conn, buf, (apr_size_t)readlen, r);
344 if (status != OK) {
346 }
348 }
349 if (readlen == -1) {
351 "receiving request body failed");
353 }
354 }
355
356 return OK;
357}
358
359
360/*
361 * Fetch response from backend and pass back to the front
362 */
364{
366 apr_bucket *b;
367 const char *location;
368 scgi_config *conf;
370 int status;
371
372 sock_data = apr_palloc(r->pool, sizeof(*sock_data));
373 sock_data->sock = conn->sock;
374 sock_data->counter = &conn->worker->s->read;
375
381
384 if (status != OK) {
386 "error reading response headers from %s:%u",
387 conn->hostname, conn->port);
388 r->status_line = NULL;
390 return status;
391 }
392
393 /* SCGI has its own body framing mechanism which we don't
394 * match against any provided Content-Length, so let the
395 * core determine C-L vs T-E based on what's actually sent.
396 */
398 apr_table_unset(r->headers_out, "Content-Length");
399 apr_table_unset(r->headers_out, "Transfer-Encoding");
400
401 conf = ap_get_module_config(r->per_dir_config, &proxy_scgi_module);
402 if (conf->sendfile && conf->sendfile != scgi_sendfile_off) {
403 short err = 1;
404
405 location = apr_table_get(r->err_headers_out, conf->sendfile);
406 if (!location) {
407 err = 0;
408 location = apr_table_get(r->headers_out, conf->sendfile);
409 }
410 if (location) {
412 sizeof(*req_conf));
414 "Found %s: %s - preparing subrequest.",
415 conf->sendfile, location);
416
417 if (err) {
419 }
420 else {
422 }
423 req_conf->location = location;
424 req_conf->type = scgi_sendfile;
425 ap_set_module_config(r->request_config, &proxy_scgi_module,
426 req_conf);
428 return OK;
429 }
430 }
431
432 if (r->status == HTTP_OK
433 && (!conf->internal_redirect /* default === On */
435 short err = 1;
436 const char *location_header = conf->internal_redirect ?
438
440 if (!location) {
441 err = 0;
443 }
444 if (location && *location == '/') {
446 sizeof(*req_conf));
447 if (ap_cstr_casecmp(location_header, "Location")) {
448 if (err) {
450 }
451 else {
453 }
454 }
455 req_conf->location = location;
457 ap_set_module_config(r->request_config, &proxy_scgi_module,
458 req_conf);
460 return OK;
461 }
462 }
463
464 if (ap_pass_brigade(r->output_filters, bb)) {
465 return AP_FILTER_ERROR;
466 }
467
468 return OK;
469}
470
471/*
472 * Internal redirect / subrequest handler, working on request_status hook
473 */
475{
477
478 if ( (*status == OK)
480 &proxy_scgi_module))) {
481 switch (req_conf->type) {
484 "Internal redirect to %s", req_conf->location);
485
486 r->status_line = NULL;
487 if (r->method_number != M_GET) {
488 /* keep HEAD, which is passed around as M_GET, too */
489 r->method = "GET";
491 }
492 apr_table_unset(r->headers_in, "Content-Length");
494 return OK;
495 /* break; */
496
497 case scgi_sendfile:
499 "File subrequest to %s", req_conf->location);
500 do {
502
503 rr = ap_sub_req_lookup_file(req_conf->location, r,
505 if (rr->status == HTTP_OK && rr->finfo.filetype != APR_NOFILE) {
506 /*
507 * We don't touch Content-Length here. It might be
508 * borked (there's plenty of room for a race condition).
509 * Either the backend sets it or it's gonna be chunked.
510 */
512 }
513 else {
515 "Subrequest to file '%s' not possible. "
516 "(rr->status=%d, rr->finfo.filetype=%d)",
517 req_conf->location, rr->status,
518 rr->finfo.filetype);
520 return *status;
521 }
522 } while (0);
523
524 return OK;
525 /* break; */
526 }
527 }
528
529 return DECLINED;
530}
531
532
533/*
534 * This handles scgi:(dest) URLs
535 */
537 proxy_server_conf *conf, char *url,
538 const char *proxyname, apr_port_t proxyport)
539{
540 int status;
541 proxy_conn_rec *backend = NULL;
542 apr_pool_t *p = r->pool;
543 apr_uri_t *uri;
544 char dummy;
545
546 if (ap_cstr_casecmpn(url, SCHEME "://", sizeof(SCHEME) + 2)) {
548 "declining URL %s", url);
549 return DECLINED;
550 }
551
552 /* Create space for state information */
554 r->server);
555 if (status != OK) {
556 goto cleanup;
557 }
558 backend->is_ssl = 0;
559
560 /* Step One: Determine Who To Connect To */
561 uri = apr_palloc(p, sizeof(*uri));
562 status = ap_proxy_determine_connection(p, r, conf, worker, backend,
564 &dummy, 1);
565 if (status != OK) {
566 goto cleanup;
567 }
568
569 /* Step Two: Make the Connection */
570 if (ap_proxy_connect_backend(PROXY_FUNCTION, backend, worker, r->server)) {
572 "failed to make connection to backend: %s:%u",
573 backend->hostname, backend->port);
575 goto cleanup;
576 }
577
578 /* Step Three: Process the Request */
580 || ((status = send_headers(r, backend)) != OK)
581 || ((status = send_request_body(r, backend)) != OK)
582 || ((status = pass_response(r, backend)) != OK)) {
583 goto cleanup;
584 }
585
586cleanup:
587 if (backend) {
588 backend->close = 1; /* always close the socket */
590 }
591 return status;
592}
593
594
596{
597 scgi_config *conf=apr_palloc(p, sizeof(*conf));
598
599 conf->sendfile = NULL; /* === default (off) */
600 conf->internal_redirect = NULL; /* === default (on) */
601
602 return conf;
603}
604
605
606static void *merge_scgi_config(apr_pool_t *p, void *base_, void *add_)
607{
608 scgi_config *base=base_, *add=add_, *conf=apr_palloc(p, sizeof(*conf));
609
610 conf->sendfile = add->sendfile ? add->sendfile: base->sendfile;
611 conf->internal_redirect = add->internal_redirect
612 ? add->internal_redirect
613 : base->internal_redirect;
614 return conf;
615}
616
617
618static const char *scgi_set_send_file(cmd_parms *cmd, void *mconfig,
619 const char *arg)
620{
621 scgi_config *conf=mconfig;
622
623 if (!strcasecmp(arg, "Off")) {
625 }
626 else if (!strcasecmp(arg, "On")) {
628 }
629 else {
630 conf->sendfile = arg;
631 }
632 return NULL;
633}
634
635
637 const char *arg)
638{
639 scgi_config *conf = mconfig;
640
641 if (!strcasecmp(arg, "Off")) {
643 }
644 else if (!strcasecmp(arg, "On")) {
646 }
647 else {
648 conf->internal_redirect = arg;
649 }
650 return NULL;
651}
652
653
654static const command_rec scgi_cmds[] =
655{
656 AP_INIT_TAKE1("ProxySCGISendfile", scgi_set_send_file, NULL,
658 "The name of the X-Sendfile pseudo response header or "
659 "On or Off"),
660 AP_INIT_TAKE1("ProxySCGIInternalRedirect", scgi_set_internal_redirect, NULL,
662 "The name of the pseudo response header or On or Off"),
663 {NULL}
664};
665
666
674
675
678 create_scgi_config, /* create per-directory config structure */
679 merge_scgi_config, /* merge per-directory config structures */
680 NULL, /* create per-server config structure */
681 NULL, /* merge per-server config structures */
682 scgi_cmds, /* command table */
683 register_hooks /* register hooks */
684};
ap hook functions and macros
const char apr_size_t len
Definition ap_regex.h:187
APR-UTIL Buckets/Bucket Brigades.
Apache optional hook functions.
apr_size_t const unsigned char unsigned int unsigned int d
Definition apr_siphash.h:72
APR Strings library.
#define AP_INIT_TAKE1(directive, func, mconfig, where, help)
#define ap_get_module_config(v, m)
#define AP_DECLARE_MODULE(foo)
ap_conf_vector_t * base
#define ap_set_module_config(v, m, val)
request_rec int int apr_table_t const char * path
request_rec * r
#define AP_FILTER_ERROR
Definition httpd.h:473
#define AP_IOBUFSIZE
Definition httpd.h:306
#define DECLINED
Definition httpd.h:457
#define OK
Definition httpd.h:456
apr_status_t ap_pass_brigade(ap_filter_t *filter, apr_bucket_brigade *bucket)
#define ap_get_core_module_config(v)
Definition http_core.h:383
#define APLOGNO(n)
Definition http_log.h:117
#define ap_log_rerror
Definition http_log.h:454
#define APLOG_ERR
Definition http_log.h:67
#define APLOG_MARK
Definition http_log.h:283
#define APLOG_DEBUG
Definition http_log.h:71
#define APLOG_MODULE_INDEX
Definition http_log.h:168
const unsigned char * buf
Definition util_md5.h:50
int ap_should_client_block(request_rec *r)
long ap_get_client_block(request_rec *r, char *buffer, apr_size_t bufsiz)
int ap_setup_client_block(request_rec *r, int read_policy)
void ap_internal_redirect_handler(const char *new_uri, request_rec *r)
int ap_run_sub_req(request_rec *r)
Definition request.c:2528
request_rec * ap_sub_req_lookup_file(const char *new_file, const request_rec *r, ap_filter_t *next_filter)
Definition request.c:2433
void ap_add_common_vars(request_rec *r)
int ap_scan_script_header_err_brigade_ex(request_rec *r, apr_bucket_brigade *bb, char *buffer, int module_index)
void ap_add_cgi_vars(request_rec *r)
#define AP_TRUST_CGILIKE_CL_ENVVAR
const char apr_port_t port
Definition http_vhost.h:125
void * dummy
Definition http_vhost.h:62
const char * host
Definition http_vhost.h:124
void const char * arg
Definition http_vhost.h:63
#define APR_EOF
Definition apr_errno.h:461
#define APR_BUCKET_INIT(e)
#define APR_BUCKET_INSERT_AFTER(a, b)
#define APR_BRIGADE_INSERT_TAIL(b, e)
apr_read_type_e
Definition apr_buckets.h:57
#define APR_BUCKET_BUFF_SIZE
Definition apr_buckets.h:54
apr_bucket apr_bucket_brigade * a
int apr_off_t * length
@ APR_NONBLOCK_READ
Definition apr_buckets.h:59
const char apr_ssize_t int flags
Definition apr_encode.h:168
const char * url
Definition apr_escape.h:120
#define APR_HOOK_FIRST
Definition apr_hooks.h:301
#define APR_HOOK_MIDDLE
Definition apr_hooks.h:303
#define APR_OPTIONAL_HOOK(ns, name, pfn, aszPre, aszSucc, nOrder)
const char * uri
Definition apr_uri.h:159
#define ACCESS_CONF
#define RSRC_CONF
#define HTTP_OK
Definition httpd.h:490
#define HTTP_BAD_REQUEST
Definition httpd.h:508
#define HTTP_SERVICE_UNAVAILABLE
Definition httpd.h:538
#define HTTP_INTERNAL_SERVER_ERROR
Definition httpd.h:535
int ap_proxy_connect_backend(const char *proxy_function, proxy_conn_rec *conn, proxy_worker *worker, server_rec *s)
char * ap_proxy_canon_netloc(apr_pool_t *p, char **const urlp, char **userp, char **passwordp, char **hostp, apr_port_t *port)
Definition proxy_util.c:342
int ap_proxy_release_connection(const char *proxy_function, proxy_conn_rec *conn, server_rec *s)
int ap_proxy_acquire_connection(const char *proxy_function, proxy_conn_rec **conn, proxy_worker *worker, server_rec *s)
char * ap_proxy_canonenc_ex(apr_pool_t *p, const char *x, int len, enum enctype t, int flags, int proxyreq)
Definition proxy_util.c:220
#define PROXY_CANONENC_NOENCODEDSLASHENCODING
Definition mod_proxy.h:81
void proxy_hook_canon_handler(proxy_HOOK_canon_handler_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
Definition mod_proxy.c:3412
int ap_proxy_determine_connection(apr_pool_t *p, request_rec *r, proxy_server_conf *conf, proxy_worker *worker, proxy_conn_rec *conn, apr_uri_t *uri, char **url, const char *proxyname, apr_port_t proxyport, char *server_portstr, int server_portstr_size)
void proxy_hook_scheme_handler(proxy_HOOK_scheme_handler_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
Definition mod_proxy.c:3406
@ enc_path
Definition mod_proxy.h:76
#define M_GET
Definition httpd.h:592
#define STANDARD20_MODULE_STUFF
#define ap_strchr(s, c)
Definition httpd.h:2351
int ap_cstr_casecmp(const char *s1, const char *s2)
Definition util.c:3542
int ap_cstr_casecmpn(const char *s1, const char *s2, apr_size_t n)
Definition util.c:3559
apr_size_t size
apr_uint32_t val
Definition apr_atomic.h:66
const apr_array_header_t * list
Definition apr_cstr.h:105
#define APR_SUCCESS
Definition apr_errno.h:225
int apr_status_t
Definition apr_errno.h:44
@ APR_NOFILE
const char * key
void * data
void const char apr_status_t(* cleanup)(void *))
int strcasecmp(const char *a, const char *b)
const apr_hash_t * h
Definition apr_hash.h:97
char const *const char const *const ** env
apr_uint16_t apr_port_t
apr_pool_t * b
Definition apr_pools.h:529
apr_int32_t apr_int32_t apr_int32_t err
apr_cmdtype_e cmd
int int status
apr_int64_t apr_interval_time_t
Definition apr_time.h:55
#define REQUEST_CHUNKED_ERROR
Definition httpd.h:748
Apache Configuration.
Apache Logging library.
HTTP protocol handling.
Apache Request library.
HTTP Daemon routines.
apr_pool_t * p
Definition md_event.c:32
Proxy Extension Module for Apache.
#define SCGI_PROTOCOL_VERSION
static const char * scgi_set_send_file(cmd_parms *cmd, void *mconfig, const char *arg)
static const apr_bucket_type_t bucket_type_socket_ex
#define SCHEME
static apr_status_t bucket_socket_ex_read(apr_bucket *a, const char **str, apr_size_t *len, apr_read_type_e block)
static int pass_response(request_rec *r, proxy_conn_rec *conn)
const char * scgi_sendfile_off
static apr_bucket * bucket_socket_ex_make(apr_bucket *b, socket_ex_data *data)
const char * scgi_internal_redirect_on
#define SCGI_MAGIC
static const char * scgi_set_internal_redirect(cmd_parms *cmd, void *mconfig, const char *arg)
#define CONTENT_LENGTH
static apr_bucket * bucket_socket_ex_create(socket_ex_data *data, apr_bucket_alloc_t *list)
static void register_hooks(apr_pool_t *p)
static int send_headers(request_rec *r, proxy_conn_rec *conn)
static int scgi_canon(request_rec *r, char *url)
#define GATEWAY_INTERFACE
const char * scgi_internal_redirect_off
#define PROXY_FUNCTION
static void * create_scgi_config(apr_pool_t *p, char *dummy)
static int scgi_handler(request_rec *r, proxy_worker *worker, proxy_server_conf *conf, char *url, const char *proxyname, apr_port_t proxyport)
scgi_request_type
@ scgi_sendfile
@ scgi_internal_redirect
const char * scgi_sendfile_on
static int send_request_body(request_rec *r, proxy_conn_rec *conn)
static const command_rec scgi_cmds[]
static void * merge_scgi_config(apr_pool_t *p, void *base_, void *add_)
static int scgi_request_status(int *status, request_rec *r)
static int sendall(proxy_conn_rec *conn, const char *buf, apr_size_t length, request_rec *r)
return NULL
Definition mod_so.c:359
Shared SCGI-related definitions.
#define SCGI_DEF_PORT
Definition scgi.h:32
apr_bucket_alloc_t * list
void * data
Definition apr_tables.h:81
struct apr_bucket_alloc_t * bucket_alloc
Definition httpd.h:1201
Per-directory configuration.
Definition http_core.h:527
const char * hostname
Definition mod_proxy.h:275
apr_socket_t * sock
Definition mod_proxy.h:278
proxy_worker * worker
Definition mod_proxy.h:273
apr_port_t port
Definition mod_proxy.h:282
unsigned int is_ssl
Definition mod_proxy.h:283
unsigned int close
Definition mod_proxy.h:284
apr_off_t transferred
Definition mod_proxy.h:462
proxy_worker_shared * s
Definition mod_proxy.h:505
A structure that represents the current request.
Definition httpd.h:845
int status
Definition httpd.h:891
struct ap_filter_t * output_filters
Definition httpd.h:1070
int method_number
Definition httpd.h:898
apr_pool_t * pool
Definition httpd.h:847
char * filename
Definition httpd.h:1018
apr_off_t remaining
Definition httpd.h:959
int proxyreq
Definition httpd.h:873
conn_rec * connection
Definition httpd.h:849
apr_table_t * err_headers_out
Definition httpd.h:981
struct ap_conf_vector_t * request_config
Definition httpd.h:1049
apr_table_t * headers_in
Definition httpd.h:976
apr_table_t * subprocess_env
Definition httpd.h:983
server_rec * server
Definition httpd.h:851
struct ap_conf_vector_t * per_dir_config
Definition httpd.h:1047
const char * status_line
Definition httpd.h:889
const char * method
Definition httpd.h:900
char * path_info
Definition httpd.h:1024
apr_table_t * headers_out
Definition httpd.h:978
const char * internal_redirect
const char * sendfile
const char * location
scgi_request_type type
apr_off_t * counter
apr_socket_t * sock
apr_status_t apr_socket_send(apr_socket_t *sock, const char *buf, apr_size_t *len)
Definition sendrecv.c:30
apr_status_t apr_socket_recv(apr_socket_t *sock, char *buf, apr_size_t *len)
Definition sendrecv.c:70
apr_status_t apr_socket_timeout_set(apr_socket_t *sock, apr_interval_time_t t)
Definition sockopt.c:75
apr_status_t apr_socket_timeout_get(apr_socket_t *sock, apr_interval_time_t *t)
Definition sockopt.c:355
#define str
Apache script tools.
IN ULONG IN INT timeout