Apache HTTPD
ajp_header.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#include "ajp_header.h"
18#include "ajp.h"
19
20#include "util_script.h"
21
23
24static const char *response_trans_headers[] = {
25 "Content-Type",
26 "Content-Language",
27 "Content-Length",
28 "Date",
29 "Last-Modified",
30 "Location",
31 "Set-Cookie",
32 "Set-Cookie2",
33 "Servlet-Engine",
34 "Status",
35 "WWW-Authenticate"
36};
37
38static const char *long_res_header_for_sc(int sc)
39{
40 const char *rc = NULL;
41 sc = sc & 0X00FF;
43 rc = response_trans_headers[sc - 1];
44 }
45
46 return rc;
47}
48
49#define UNKNOWN_METHOD (-1)
50
51static int sc_for_req_header(const char *header_name)
52{
53 char header[16];
54 apr_size_t len = strlen(header_name);
55 const char *p = header_name;
56 int i = 0;
57
58 /* ACCEPT-LANGUAGE is the longest header
59 * that is of interest.
60 */
61 if (len < 4 || len > 15)
62 return UNKNOWN_METHOD;
63
64 memset(header, 0, sizeof header);
65 while (*p)
66 header[i++] = apr_toupper(*p++);
67 header[i] = '\0';
68 p = &header[1];
69
70 switch (header[0]) {
71 case 'A':
72 if (memcmp(p, "CCEPT", 5) == 0) {
73 if (!header[6])
74 return SC_ACCEPT;
75 else if (header[6] == '-') {
76 p += 6;
77 if (strcmp(p, "CHARSET") == 0)
78 return SC_ACCEPT_CHARSET;
79 else if (strcmp(p, "ENCODING") == 0)
80 return SC_ACCEPT_ENCODING;
81 else if (strcmp(p, "LANGUAGE") == 0)
82 return SC_ACCEPT_LANGUAGE;
83 else
84 return UNKNOWN_METHOD;
85 }
86 else
87 return UNKNOWN_METHOD;
88 }
89 else if (strcmp(p, "UTHORIZATION") == 0)
90 return SC_AUTHORIZATION;
91 else
92 return UNKNOWN_METHOD;
93 break;
94 case 'C':
95 if (strcmp(p, "OOKIE2") == 0)
96 return SC_COOKIE2;
97 else if (strcmp(p, "OOKIE") == 0)
98 return SC_COOKIE;
99 else if (strcmp(p, "ONNECTION") == 0)
100 return SC_CONNECTION;
101 else if (strcmp(p, "ONTENT-TYPE") == 0)
102 return SC_CONTENT_TYPE;
103 else if (strcmp(p, "ONTENT-LENGTH") == 0)
104 return SC_CONTENT_LENGTH;
105 else
106 return UNKNOWN_METHOD;
107 break;
108 case 'H':
109 if (strcmp(p, "OST") == 0)
110 return SC_HOST;
111 else
112 return UNKNOWN_METHOD;
113 break;
114 case 'P':
115 if (strcmp(p, "RAGMA") == 0)
116 return SC_PRAGMA;
117 else
118 return UNKNOWN_METHOD;
119 break;
120 case 'R':
121 if (strcmp(p, "EFERER") == 0)
122 return SC_REFERER;
123 else
124 return UNKNOWN_METHOD;
125 break;
126 case 'U':
127 if (strcmp(p, "SER-AGENT") == 0)
128 return SC_USER_AGENT;
129 else
130 return UNKNOWN_METHOD;
131 break;
132 default:
133 return UNKNOWN_METHOD;
134 }
135
136 /* NOTREACHED */
137}
138
139/* Apache method number to SC methods transform table */
140static const unsigned char sc_for_req_method_table[] = {
141 SC_M_GET,
142 SC_M_PUT,
143 SC_M_POST,
145 0, /* M_CONNECT */
148 0, /* M_PATCH */
152 SC_M_COPY,
153 SC_M_MOVE,
154 SC_M_LOCK,
167 0 /* M_INVALID */
168};
169
171{
174 return UNKNOWN_METHOD;
175 }
176 else if (r->header_only) {
177 return SC_M_HEAD;
178 }
179 else {
182 }
183}
184
185/*
186 * Message structure
187 *
188 *
189AJPV13_REQUEST/AJPV14_REQUEST=
190 request_prefix (1) (byte)
191 method (byte)
192 protocol (string)
193 req_uri (string)
194 remote_addr (string)
195 remote_host (string)
196 server_name (string)
197 server_port (short)
198 is_ssl (boolean)
199 num_headers (short)
200 num_headers*(req_header_name header_value)
201
202 ?context (byte)(string)
203 ?servlet_path (byte)(string)
204 ?remote_user (byte)(string)
205 ?auth_type (byte)(string)
206 ?query_string (byte)(string)
207 ?jvm_route (byte)(string)
208 ?ssl_cert (byte)(string)
209 ?ssl_cipher (byte)(string)
210 ?ssl_session (byte)(string)
211 ?ssl_key_size (byte)(int) via JkOptions +ForwardKeySize
212 request_terminator (byte)
213 ?body content_length*(var binary)
214
215 */
216
218 request_rec *r,
219 apr_uri_t *uri,
220 const char *secret)
221{
222 int method;
224 apr_byte_t is_ssl;
225 char *remote_host;
226 const char *session_route, *envvar;
228 const apr_table_entry_t *elts = (const apr_table_entry_t *)arr->elts;
229
230 ap_log_rerror(APLOG_MARK, APLOG_TRACE8, 0, r, "Into ajp_marshal_into_msgb");
231
234 "ajp_marshal_into_msgb - Sending unknown method %s as request attribute",
235 r->method);
237 }
238
240
243 num_headers = t->nelts;
244 }
245
246 remote_host = (char *)ap_get_useragent_host(r, REMOTE_HOST, NULL);
247
248 ajp_msg_reset(msg);
249
253 ajp_msg_append_string(msg, uri->path) ||
255 ajp_msg_append_string(msg, remote_host) ||
258 ajp_msg_append_uint8(msg, is_ssl) ||
260
262 "ajp_marshal_into_msgb: "
263 "Error appending the message beginning");
264 return APR_EGENERAL;
265 }
266
267 for (i = 0 ; i < num_headers ; i++) {
268 int sc;
270 const apr_table_entry_t *elts = (apr_table_entry_t *)t->elts;
271
272 if ((sc = sc_for_req_header(elts[i].key)) != UNKNOWN_METHOD) {
273 if (ajp_msg_append_uint16(msg, (apr_uint16_t)sc)) {
275 "ajp_marshal_into_msgb: "
276 "Error appending the header name");
277 return AJP_EOVERFLOW;
278 }
279 }
280 else {
281 if (ajp_msg_append_string(msg, elts[i].key)) {
283 "ajp_marshal_into_msgb: "
284 "Error appending the header name");
285 return AJP_EOVERFLOW;
286 }
287 }
288
289 if (ajp_msg_append_string(msg, elts[i].val)) {
291 "ajp_marshal_into_msgb: "
292 "Error appending the header value");
293 return AJP_EOVERFLOW;
294 }
296 "ajp_marshal_into_msgb: Header[%d] [%s] = [%s]",
297 i, elts[i].key, elts[i].val);
298 }
299
300 if (secret) {
304 "ajp_marshal_into_msgb: "
305 "Error appending secret");
306 return APR_EGENERAL;
307 }
308 }
309
310 if (r->user) {
314 "ajp_marshal_into_msgb: "
315 "Error appending the remote user");
316 return AJP_EOVERFLOW;
317 }
318 }
319 if (r->ap_auth_type) {
323 "ajp_marshal_into_msgb: "
324 "Error appending the auth type");
325 return AJP_EOVERFLOW;
326 }
327 }
328 /* XXXX ebcdic (args converted?) */
329 if (uri->query) {
331 ajp_msg_append_string(msg, uri->query)) {
333 "ajp_marshal_into_msgb: "
334 "Error appending the query string");
335 return AJP_EOVERFLOW;
336 }
337 }
338 if ((session_route = apr_table_get(r->notes, "session-route"))) {
342 "ajp_marshal_into_msgb: "
343 "Error appending the jvm route");
344 return AJP_EOVERFLOW;
345 }
346 }
347/* XXX: Is the subprocess_env a right place?
348 * <Location /examples>
349 * ProxyPass ajp://remote:8009/servlets-examples
350 * SetEnv SSL_SESSION_ID CUSTOM_SSL_SESSION_ID
351 * </Location>
352 */
353 /*
354 * Only lookup SSL variables if we are currently running HTTPS.
355 * Furthermore ensure that only variables get set in the AJP message
356 * that are not NULL and not empty.
357 */
358 if (is_ssl) {
361 && envvar[0]) {
363 || ajp_msg_append_string(msg, envvar)) {
365 "ajp_marshal_into_msgb: "
366 "Error appending the SSL certificates");
367 return AJP_EOVERFLOW;
368 }
369 }
370
373 && envvar[0]) {
375 || ajp_msg_append_string(msg, envvar)) {
377 "ajp_marshal_into_msgb: "
378 "Error appending the SSL ciphers");
379 return AJP_EOVERFLOW;
380 }
381 }
382
385 && envvar[0]) {
387 || ajp_msg_append_string(msg, envvar)) {
389 "ajp_marshal_into_msgb: "
390 "Error appending the SSL session");
391 return AJP_EOVERFLOW;
392 }
393 }
394
395 /* ssl_key_size is required by Servlet 2.3 API */
398 && envvar[0]) {
399
401 || ajp_msg_append_uint16(msg, (unsigned short) atoi(envvar))) {
403 "ajp_marshal_into_msgb: "
404 "Error appending the SSL key size");
405 return APR_EGENERAL;
406 }
407 }
408 }
409 /* If the method was unrecognized, encode it as an attribute */
410 if (method == SC_M_JK_STORED) {
412 || ajp_msg_append_string(msg, r->method)) {
414 "ajp_marshal_into_msgb: "
415 "Error appending the method '%s' as request attribute",
416 r->method);
417 return AJP_EOVERFLOW;
418 }
419 }
420 /* Forward the SSL protocol name.
421 * Modern Tomcat versions know how to retrieve
422 * the protocol name from this attribute.
423 */
424 if (is_ssl) {
427 && envvar[0]) {
428 const char *key = SC_A_SSL_PROTOCOL;
433 "ajp_marshal_into_msgb: "
434 "Error appending attribute %s=%s",
435 key, envvar);
436 return AJP_EOVERFLOW;
437 }
438 }
439 }
440 /* Forward the remote port information, which was forgotten
441 * from the builtin data of the AJP 13 protocol.
442 * Since the servlet spec allows to retrieve it via getRemotePort(),
443 * we provide the port to the Tomcat connector as a request
444 * attribute. Modern Tomcat versions know how to retrieve
445 * the remote port from this attribute.
446 */
447 {
448 const char *key = SC_A_REQ_REMOTE_PORT;
449 char *val = apr_itoa(r->pool, r->useragent_addr->port);
454 "ajp_marshal_into_msgb: "
455 "Error appending attribute %s=%s",
456 key, val);
457 return AJP_EOVERFLOW;
458 }
459 }
460 /* Forward the local ip address information, which was forgotten
461 * from the builtin data of the AJP 13 protocol.
462 * Since the servlet spec allows to retrieve it via getLocalAddr(),
463 * we provide the address to the Tomcat connector as a request
464 * attribute. Modern Tomcat versions know how to retrieve
465 * the local address from this attribute.
466 */
467 {
468 const char *key = SC_A_REQ_LOCAL_ADDR;
469 char *val = r->connection->local_ip;
474 "ajp_marshal_into_msgb: "
475 "Error appending attribute %s=%s",
476 key, val);
477 return AJP_EOVERFLOW;
478 }
479 }
480 /* Use the environment vars prefixed with AJP_
481 * and pass it to the header striping that prefix.
482 */
483 for (i = 0; i < (apr_uint32_t)arr->nelts; i++) {
484 if (!strncmp(elts[i].key, "AJP_", 4)) {
486 ajp_msg_append_string(msg, elts[i].key + 4) ||
487 ajp_msg_append_string(msg, elts[i].val)) {
489 "ajp_marshal_into_msgb: "
490 "Error appending attribute %s=%s",
491 elts[i].key, elts[i].val);
492 return AJP_EOVERFLOW;
493 }
494 }
495 }
496
499 "ajp_marshal_into_msgb: "
500 "Error appending the message end");
501 return AJP_EOVERFLOW;
502 }
503
505 "ajp_marshal_into_msgb: Done");
506 return APR_SUCCESS;
507}
508
509/*
510AJPV13_RESPONSE/AJPV14_RESPONSE:=
511 response_prefix (2)
512 status (short)
513 status_msg (short)
514 num_headers (short)
515 num_headers*(res_header_name header_value)
516 *body_chunk
517 terminator boolean <! -- recycle connection or not -->
518
519req_header_name :=
520 sc_req_header_name | (string)
521
522res_header_name :=
523 sc_res_header_name | (string)
524
525header_value :=
526 (string)
527
528body_chunk :=
529 length (short)
530 body length*(var binary)
531
532 */
533
534static int addit_dammit(void *v, const char *key, const char *val)
535{
537 return 1;
538}
539
541 request_rec *r,
542 proxy_dir_conf *dconf)
543{
546 const char *ptr;
548 int i;
549
551
552 if (rc != APR_SUCCESS) {
554 "ajp_unmarshal_response: Null status");
555 return rc;
556 }
557 r->status = status;
558
559 rc = ajp_msg_get_string(msg, &ptr);
560 if (rc == APR_SUCCESS) {
561#if APR_CHARSET_EBCDIC /* copy only if we have to */
562 ptr = apr_pstrdup(r->pool, ptr);
563 ap_xlate_proto_from_ascii(ptr, strlen(ptr));
564#endif
565 r->status_line = apr_psprintf(r->pool, "%d %s", status, ptr);
566 }
567 else {
568 r->status_line = NULL;
569 }
570
572 "ajp_unmarshal_response: status = %d", status);
573
575 if (rc == APR_SUCCESS) {
577
578 /* First, tuck away all already existing cookies */
579 /*
580 * Could optimize here, but just in case we want to
581 * also save other headers, keep this logic.
582 */
585 "Set-Cookie", NULL);
587 }
588 else {
589 /*
590 * Reset headers, but not to NULL because things below the chain expect
591 * this to be non NULL e.g. the ap_content_length_filter.
592 */
594 num_headers = 0;
596 "ajp_unmarshal_response: Bad number of headers");
597 return rc;
598 }
599
601 "ajp_unmarshal_response: Number of headers is = %d",
603
604 for (i = 0; i < (int)num_headers; i++) {
606 const char *stringname;
607 const char *value;
608 rc = ajp_msg_peek_uint16(msg, &name);
609 if (rc != APR_SUCCESS) {
610 return rc;
611 }
612
613 if ((name & 0XFF00) == 0XA000) {
616 if (stringname == NULL) {
618 "ajp_unmarshal_response: "
619 "No such sc (%08x)",
620 name);
621 return AJP_EBAD_HEADER;
622 }
623 }
624 else {
625 name = 0;
627 if (rc != APR_SUCCESS) {
629 "ajp_unmarshal_response: "
630 "Null header name");
631 return rc;
632 }
634 }
635
636 rc = ajp_msg_get_string(msg, &value);
637 if (rc != APR_SUCCESS) {
639 "ajp_unmarshal_response: "
640 "Null header value");
641 return rc;
642 }
643
644 /* Set-Cookie need additional processing */
645 if (!ap_cstr_casecmp(stringname, "Set-Cookie")) {
647 }
648 /* Location, Content-Location, URI and Destination need additional
649 * processing */
650 else if (!ap_cstr_casecmp(stringname, "Location")
651 || !ap_cstr_casecmp(stringname, "Content-Location")
652 || !ap_cstr_casecmp(stringname, "URI")
653 || !ap_cstr_casecmp(stringname, "Destination"))
654 {
656 }
657
660 "ajp_unmarshal_response: Header[%d] [%s] = [%s]",
661 i, stringname, value);
662
664
665 /* Content-type needs an additional handling */
666 if (ap_cstr_casecmp(stringname, "Content-Type") == 0) {
667 /* add corresponding filter */
670 "ajp_unmarshal_response: ap_set_content_type to '%s'", value);
671 }
672 }
673
674 /* AJP has its own body framing mechanism which we don't
675 * match against any provided Content-Length, so let the
676 * core determine C-L vs T-E based on what's actually sent.
677 */
679 apr_table_unset(r->headers_out, "Content-Length");
680 apr_table_unset(r->headers_out, "Transfer-Encoding");
681
682 return APR_SUCCESS;
683}
684
685/*
686 * Build the ajp header message and send it
687 */
689 request_rec *r,
691 apr_uri_t *uri,
692 const char *secret)
693{
694 ajp_msg_t *msg;
696
697 rc = ajp_msg_create(r->pool, buffsize, &msg);
698 if (rc != APR_SUCCESS) {
700 "ajp_send_header: ajp_msg_create failed");
701 return rc;
702 }
703
705 if (rc != APR_SUCCESS) {
707 "ajp_send_header: ajp_marshal_into_msgb failed");
708 return rc;
709 }
710
711 rc = ajp_ilink_send(sock, msg);
712 ajp_msg_log(r, msg, "ajp_send_header: ajp_ilink_send packet dump");
713 if (rc != APR_SUCCESS) {
715 "ajp_send_header: ajp_ilink_send failed");
716 return rc;
717 }
718
719 return APR_SUCCESS;
720}
721
722/*
723 * Read the ajp message and return the type of the message.
724 */
726 request_rec *r,
728 ajp_msg_t **msg)
729{
732
733 if (*msg) {
734 rc = ajp_msg_reuse(*msg);
735 if (rc != APR_SUCCESS) {
737 "ajp_read_header: ajp_msg_reuse failed");
738 return rc;
739 }
740 }
741 else {
742 rc = ajp_msg_create(r->pool, buffsize, msg);
743 if (rc != APR_SUCCESS) {
745 "ajp_read_header: ajp_msg_create failed");
746 return rc;
747 }
748 }
749 ajp_msg_reset(*msg);
750 rc = ajp_ilink_receive(sock, *msg);
751 if (rc != APR_SUCCESS) {
753 "ajp_read_header: ajp_ilink_receive failed");
754 return rc;
755 }
756 ajp_msg_log(r, *msg, "ajp_read_header: ajp_ilink_receive packet dump");
757 rc = ajp_msg_peek_uint8(*msg, &result);
758 if (rc != APR_SUCCESS) {
760 "ajp_read_header: ajp_msg_peek_uint8 failed");
761 return rc;
762 }
764 "ajp_read_header: ajp_ilink_received %s (0x%02x)",
766 return APR_SUCCESS;
767}
768
769/* parse the msg to read the type */
771{
775 "ajp_parse_type: got %s (0x%02x)",
777 return (int) result;
778}
779
780/* parse the header */
782 ajp_msg_t *msg)
783{
786
787 rc = ajp_msg_get_uint8(msg, &result);
788 if (rc != APR_SUCCESS) {
790 "ajp_parse_headers: ajp_msg_get_byte failed");
791 return rc;
792 }
795 "ajp_parse_headers: wrong type %s (0x%02x) expecting %s (0x%02x)",
798 return AJP_EBAD_HEADER;
799 }
800 return ajp_unmarshal_response(msg, r, conf);
801}
802
803/* parse the body and return data address and length */
805 apr_uint16_t *len, char **ptr)
806{
810
811 rc = ajp_msg_get_uint8(msg, &result);
812 if (rc != APR_SUCCESS) {
814 "ajp_parse_data: ajp_msg_get_byte failed");
815 return rc;
816 }
819 "ajp_parse_data: wrong type %s (0x%02x) expecting %s (0x%02x)",
822 return AJP_EBAD_HEADER;
823 }
824 rc = ajp_msg_get_uint16(msg, len);
825 if (rc != APR_SUCCESS) {
826 return rc;
827 }
828 /*
829 * msg->len contains the complete length of the message including all
830 * headers. So the expected length for a CMD_AJP13_SEND_BODY_CHUNK is
831 * msg->len minus the sum of
832 * AJP_HEADER_LEN : The length of the header to every AJP message.
833 * AJP_HEADER_SZ_LEN : The header giving the size of the chunk.
834 * 1 : The CMD_AJP13_SEND_BODY_CHUNK indicator byte (0x03).
835 * 1 : The last byte of this message always seems to be
836 * 0x00 and is not part of the chunk.
837 */
839 if (*len != expected_len) {
841 "ajp_parse_data: Wrong chunk length. Length of chunk is %i,"
842 " expected length is %i.", *len, expected_len);
843 return AJP_EBAD_HEADER;
844 }
845 *ptr = (char *)&(msg->buf[msg->pos]);
846 return APR_SUCCESS;
847}
848
849/* Check the reuse flag in CMD_AJP13_END_RESPONSE */
852{
855
856 rc = ajp_msg_get_uint8(msg, &result);
857 if (rc != APR_SUCCESS) {
859 "ajp_parse_reuse: ajp_msg_get_byte failed");
860 return rc;
861 }
864 "ajp_parse_reuse: wrong type %s (0x%02x) expecting %s (0x%02x)",
867 return AJP_EBAD_HEADER;
868 }
869 return ajp_msg_get_uint8(msg, reuse);
870}
871
872/*
873 * Allocate a msg to send data
874 */
876 ajp_msg_t **msg)
877{
879
880 if ((rc = ajp_msg_create(pool, *len, msg)) != APR_SUCCESS)
881 return rc;
882 ajp_msg_reset(*msg);
883 *ptr = (char *)&((*msg)->buf[6]);
884 *len = *len - 6;
885
886 return APR_SUCCESS;
887}
888
889/*
890 * Send the data message
891 */
894{
895
896 msg->buf[4] = (apr_byte_t)((len >> 8) & 0xFF);
897 msg->buf[5] = (apr_byte_t)(len & 0xFF);
898
899 msg->len += len + 2; /* + 1 XXXX where is '\0' */
900
901 return ajp_ilink_send(sock, msg);
902
903}
Apache Jserv Protocol.
static const unsigned char sc_for_req_method_table[]
Definition ajp_header.c:140
static int sc_for_req_method_by_id(request_rec *r)
Definition ajp_header.c:170
static int sc_for_req_header(const char *header_name)
Definition ajp_header.c:51
static apr_status_t ajp_marshal_into_msgb(ajp_msg_t *msg, request_rec *r, apr_uri_t *uri, const char *secret)
Definition ajp_header.c:217
static const char * long_res_header_for_sc(int sc)
Definition ajp_header.c:38
static apr_status_t ajp_unmarshal_response(ajp_msg_t *msg, request_rec *r, proxy_dir_conf *dconf)
Definition ajp_header.c:540
static const char * response_trans_headers[]
Definition ajp_header.c:24
#define UNKNOWN_METHOD
Definition ajp_header.c:49
static int addit_dammit(void *v, const char *key, const char *val)
Definition ajp_header.c:534
AJP defines.
const char apr_size_t len
Definition ap_regex.h:187
apr_status_t ajp_send_header(apr_socket_t *sock, request_rec *r, apr_size_t buffsize, apr_uri_t *uri, const char *secret)
Definition ajp_header.c:688
apr_status_t ajp_msg_peek_uint8(ajp_msg_t *msg, apr_byte_t *rvalue)
Definition ajp_msg.c:465
apr_status_t ajp_parse_reuse(request_rec *r, ajp_msg_t *msg, apr_byte_t *reuse)
Definition ajp_header.c:850
int ajp_parse_type(request_rec *r, ajp_msg_t *msg)
Definition ajp_header.c:770
apr_status_t ajp_parse_data(request_rec *r, ajp_msg_t *msg, apr_uint16_t *len, char **ptr)
Definition ajp_header.c:804
apr_status_t ajp_msg_create(apr_pool_t *pool, apr_size_t size, ajp_msg_t **rmsg)
Definition ajp_msg.c:561
apr_status_t ajp_alloc_data_msg(apr_pool_t *pool, char **ptr, apr_size_t *len, ajp_msg_t **msg)
Definition ajp_header.c:875
apr_status_t ajp_msg_append_uint8(ajp_msg_t *msg, apr_byte_t value)
Definition ajp_msg.c:308
apr_status_t ajp_msg_reuse(ajp_msg_t *msg)
Definition ajp_msg.c:204
apr_status_t ajp_msg_peek_uint16(ajp_msg_t *msg, apr_uint16_t *rvalue)
Definition ajp_msg.c:442
apr_status_t ajp_msg_log(request_rec *r, ajp_msg_t *msg, char *err)
Definition ajp_msg.c:115
apr_status_t ajp_msg_get_string(ajp_msg_t *msg, const char **rvalue)
Definition ajp_msg.c:501
apr_status_t ajp_ilink_receive(apr_socket_t *sock, ajp_msg_t *msg)
Definition ajp_link.c:74
apr_status_t ajp_msg_get_uint8(ajp_msg_t *msg, apr_byte_t *rvalue)
Definition ajp_msg.c:482
const char * ajp_type_str(int type)
Definition ajp_utils.c:121
apr_status_t ajp_send_data_msg(apr_socket_t *sock, ajp_msg_t *msg, apr_size_t len)
Definition ajp_header.c:892
apr_status_t ajp_msg_reset(ajp_msg_t *msg)
Definition ajp_msg.c:190
apr_status_t ajp_msg_append_uint16(ajp_msg_t *msg, apr_uint16_t value)
Definition ajp_msg.c:285
apr_status_t ajp_msg_get_uint16(ajp_msg_t *msg, apr_uint16_t *rvalue)
Definition ajp_msg.c:419
apr_status_t ajp_ilink_send(apr_socket_t *sock, ajp_msg_t *msg)
Definition ajp_link.c:21
apr_status_t ajp_parse_header(request_rec *r, proxy_dir_conf *conf, ajp_msg_t *msg)
Definition ajp_header.c:781
apr_status_t ajp_read_header(apr_socket_t *sock, request_rec *r, apr_size_t buffsize, ajp_msg_t **msg)
Definition ajp_header.c:725
#define ajp_msg_append_string(m, v)
Definition ajp.h:241
#define SC_COOKIE
Definition ajp_header.h:157
#define SC_COOKIE2
Definition ajp_header.h:158
#define SC_M_CHECKIN
Definition ajp_header.h:115
#define SC_REFERER
Definition ajp_header.h:161
#define SC_A_SSL_CIPHER
Definition ajp_header.h:39
#define SC_M_HEAD
Definition ajp_header.h:100
#define SC_A_JVM_ROUTE
Definition ajp_header.h:37
#define AJP_HEADER_SZ_LEN
Definition ajp.h:133
#define SC_M_OPTIONS
Definition ajp_header.h:98
#define SC_M_JK_STORED
Definition ajp_header.h:125
#define SC_PRAGMA
Definition ajp_header.h:160
#define AJP13_SSL_PROTOCOL_INDICATOR
Definition ajp.h:63
#define SC_M_UNLOCK
Definition ajp_header.h:111
#define SC_A_REMOTE_USER
Definition ajp_header.h:34
#define SC_M_REPORT
Definition ajp_header.h:113
#define SC_M_LABEL
Definition ajp_header.h:121
#define SC_CONTENT_TYPE
Definition ajp_header.h:155
#define SC_ACCEPT_ENCODING
Definition ajp_header.h:151
#define AJP13_SSL_SESSION_INDICATOR
Definition ajp.h:66
#define SC_M_MKWORKSPACE
Definition ajp_header.h:119
#define AJP_HEADER_LEN
Definition ajp.h:132
#define AJP13_SSL_CIPHER_INDICATOR
Definition ajp.h:65
#define SC_A_SSL_CERT
Definition ajp_header.h:38
#define AJP13_SSL_KEY_SIZE_INDICATOR
Definition ajp.h:67
#define SC_M_GET
Definition ajp_header.h:99
#define SC_M_PROPPATCH
Definition ajp_header.h:106
#define SC_A_REQ_REMOTE_PORT
Definition ajp_header.h:58
#define SC_USER_AGENT
Definition ajp_header.h:162
#define SC_A_REQ_ATTRIBUTE
Definition ajp_header.h:41
#define SC_ACCEPT
Definition ajp_header.h:149
#define SC_ACCEPT_CHARSET
Definition ajp_header.h:150
#define SC_A_QUERY_STRING
Definition ajp_header.h:36
#define SC_A_SECRET
Definition ajp_header.h:43
#define SC_M_LOCK
Definition ajp_header.h:110
#define SC_M_UNCHECKOUT
Definition ajp_header.h:117
#define SC_M_TRACE
Definition ajp_header.h:104
#define CMD_AJP13_SEND_HEADERS
Definition ajp.h:145
#define SC_M_PUT
Definition ajp_header.h:102
#define SC_ACCEPT_LANGUAGE
Definition ajp_header.h:152
#define SC_A_STORED_METHOD
Definition ajp_header.h:44
#define SC_M_COPY
Definition ajp_header.h:108
#define SC_A_SSL_SESSION
Definition ajp_header.h:40
#define CMD_AJP13_END_RESPONSE
Definition ajp.h:147
#define SC_M_PROPFIND
Definition ajp_header.h:105
#define SC_M_MERGE
Definition ajp_header.h:122
#define SC_A_AUTH_TYPE
Definition ajp_header.h:35
#define AJP_EOVERFLOW
Definition ajp.h:87
#define SC_M_VERSION_CONTROL
Definition ajp_header.h:114
#define SC_A_ARE_DONE
Definition ajp_header.h:45
#define SC_CONNECTION
Definition ajp_header.h:154
#define AJP13_SSL_CLIENT_CERT_INDICATOR
Definition ajp.h:64
#define SC_M_CHECKOUT
Definition ajp_header.h:116
#define SC_M_DELETE
Definition ajp_header.h:103
#define SC_A_SSL_KEY_SIZE
Definition ajp_header.h:42
#define SC_M_MKACTIVITY
Definition ajp_header.h:124
#define SC_M_UPDATE
Definition ajp_header.h:120
#define AJP_EBAD_HEADER
Definition ajp.h:99
#define SC_M_BASELINE_CONTROL
Definition ajp_header.h:123
#define SC_M_MKCOL
Definition ajp_header.h:107
#define CMD_AJP13_FORWARD_REQUEST
Definition ajp.h:141
#define CMD_AJP13_SEND_BODY_CHUNK
Definition ajp.h:143
#define SC_A_REQ_LOCAL_ADDR
Definition ajp_header.h:63
#define SC_M_MOVE
Definition ajp_header.h:109
#define SC_CONTENT_LENGTH
Definition ajp_header.h:156
#define SC_HOST
Definition ajp_header.h:159
#define SC_A_SSL_PROTOCOL
Definition ajp_header.h:53
#define SC_M_POST
Definition ajp_header.h:101
#define SC_AUTHORIZATION
Definition ajp_header.h:153
#define APLOG_USE_MODULE(foo)
request_rec * r
#define ap_xlate_proto_from_ascii(x, y)
Definition util_ebcdic.h:81
const char * ap_get_server_name(request_rec *r)
Definition core.c:1145
#define APLOG_TRACE8
Definition http_log.h:79
#define APLOGNO(n)
Definition http_log.h:117
#define APLOG_TRACE4
Definition http_log.h:75
#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_TRACE1
Definition http_log.h:72
#define APLOG_TRACE5
Definition http_log.h:76
#define APLOG_TRACE6
Definition http_log.h:77
void ap_set_content_type(request_rec *r, const char *ct)
#define AP_TRUST_CGILIKE_CL_ENVVAR
#define APR_EGENERAL
Definition apr_errno.h:313
apr_redis_t * rc
Definition apr_redis.h:173
const char * uri
Definition apr_uri.h:159
const char * ap_proxy_location_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *url)
Definition proxy_util.c:882
int ap_proxy_conn_is_https(conn_rec *c)
Definition mod_proxy.c:3075
const char * ap_proxy_cookie_reverse_map(request_rec *r, proxy_dir_conf *conf, const char *str)
const char * ap_proxy_ssl_val(apr_pool_t *p, server_rec *s, conn_rec *c, request_rec *r, const char *var)
Definition mod_proxy.c:3080
#define M_INVALID
Definition httpd.h:618
int ap_cstr_casecmp(const char *s1, const char *s2)
Definition util.c:3542
apr_size_t size
apr_uint32_t val
Definition apr_atomic.h:66
const char int apr_pool_t * pool
Definition apr_cstr.h:84
#define apr_toupper(c)
Definition apr_lib.h:233
const char * value
Definition apr_env.h:51
const char * envvar
Definition apr_env.h:42
#define APR_SUCCESS
Definition apr_errno.h:225
int apr_status_t
Definition apr_errno.h:44
const char * key
apr_array_header_t ** result
apr_socket_t * sock
apr_interval_time_t t
apr_uint32_t apr_pool_t apr_uint32_t apr_pollset_method_e method
Definition apr_poll.h:195
const apr_array_header_t * arr
Definition apr_tables.h:187
int int status
const char * ap_get_useragent_host(request_rec *req, int type, int *str_is_ip)
Definition core.c:1036
#define REMOTE_HOST
Definition http_core.h:100
apr_pool_t * p
Definition md_event.c:32
static unsigned char * secret
return NULL
Definition mod_so.c:359
int i
Definition mod_so.c:347
char * name
Definition ajp.h:113
apr_byte_t * buf
Definition ajp.h:115
apr_size_t len
Definition ajp.h:119
apr_size_t pos
Definition ajp.h:121
Definition apr_tables.h:81
apr_sockaddr_t * local_addr
Definition httpd.h:1162
char * local_ip
Definition httpd.h:1181
A structure that represents the current request.
Definition httpd.h:845
char * user
Definition httpd.h:1005
int status
Definition httpd.h:891
char * useragent_ip
Definition httpd.h:1101
int header_only
Definition httpd.h:875
apr_table_t * notes
Definition httpd.h:985
int method_number
Definition httpd.h:898
apr_pool_t * pool
Definition httpd.h:847
apr_sockaddr_t * useragent_addr
Definition httpd.h:1100
conn_rec * connection
Definition httpd.h:849
apr_table_t * headers_in
Definition httpd.h:976
char * protocol
Definition httpd.h:879
apr_table_t * subprocess_env
Definition httpd.h:983
server_rec * server
Definition httpd.h:851
const char * status_line
Definition httpd.h:889
const char * method
Definition httpd.h:900
char * ap_auth_type
Definition httpd.h:1007
apr_table_t * headers_out
Definition httpd.h:978
Apache script tools.
typedef int(WSAAPI *apr_winapi_fpt_WSAPoll)(IN OUT LPWSAPOLLFD fdArray