Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 24964 invoked from network); 2 Aug 2004 16:36:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 2 Aug 2004 16:36:21 -0000 Received: (qmail 13019 invoked by uid 500); 2 Aug 2004 16:36:03 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 12911 invoked by uid 500); 2 Aug 2004 16:36:01 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 12898 invoked by uid 500); 2 Aug 2004 16:36:01 -0000 Received: (qmail 12891 invoked by uid 99); 2 Aug 2004 16:36:01 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Mon, 02 Aug 2004 09:36:01 -0700 Received: (qmail 24625 invoked by uid 1526); 2 Aug 2004 16:36:00 -0000 Date: 2 Aug 2004 16:36:00 -0000 Message-ID: <20040802163600.24621.qmail@minotaur.apache.org> From: mturk@apache.org To: jakarta-tomcat-connectors-cvs@apache.org Subject: cvs commit: jakarta-tomcat-connectors/ajp/ajplib/test ajp_msg.c ajp_header.c ajp.h X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mturk 2004/08/02 09:36:00 Modified: ajp/ajplib/test ajp_msg.c ajp_header.c ajp.h Log: Rename _byte calls to _uint8. Revision Changes Path 1.13 +4 -4 jakarta-tomcat-connectors/ajp/ajplib/test/ajp_msg.c Index: ajp_msg.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/ajplib/test/ajp_msg.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- ajp_msg.c 1 Aug 2004 15:33:34 -0000 1.12 +++ ajp_msg.c 2 Aug 2004 16:35:59 -0000 1.13 @@ -391,11 +391,11 @@ * @param rvalue Pointer where value will be returned * @return APR_SUCCESS or error */ -apr_status_t ajp_msg_peek_byte(ajp_msg_t *msg, apr_byte_t *rvalue) +apr_status_t ajp_msg_peek_uint8(ajp_msg_t *msg, apr_byte_t *rvalue) { if (msg->pos > msg->len) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, - "ajp_msg_peek_byte(): BufferOverflowException %d %d", + "ajp_msg_peek_uint8(): BufferOverflowException %d %d", msg->pos, msg->len); return AJP_EOVERFLOW; @@ -412,12 +412,12 @@ * @param rvalue Pointer where value will be returned * @return APR_SUCCESS or error */ -apr_status_t ajp_msg_get_byte(ajp_msg_t *msg, apr_byte_t *rvalue) +apr_status_t ajp_msg_get_uint8(ajp_msg_t *msg, apr_byte_t *rvalue) { if (msg->pos > msg->len) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, NULL, - "ajp_msg_get_byte(): BufferOverflowException %d %d", + "ajp_msg_get_uint8(): BufferOverflowException %d %d", msg->pos, msg->len); return AJP_EOVERFLOW; 1.25 +15 -16 jakarta-tomcat-connectors/ajp/ajplib/test/ajp_header.c Index: ajp_header.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/ajplib/test/ajp_header.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- ajp_header.c 1 Aug 2004 16:50:27 -0000 1.24 +++ ajp_header.c 2 Aug 2004 16:35:59 -0000 1.25 @@ -538,10 +538,9 @@ apr_table_add(r->headers_out, stringname, value); /* Content-type needs an additional handling */ - if (memcmp(stringname, "Content-Type",12) == 0) { - char *ptr; - ptr = apr_pstrdup(r->pool, value); - ap_set_content_type(r, ptr); /* add corresponding filter */ + if (memcmp(stringname, "Content-Type", 12) == 0) { + /* add corresponding filter */ + ap_set_content_type(r, apr_pstrdup(r->pool, value)); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "ajp_unmarshal_response: ap_set_content_type done"); } @@ -606,7 +605,7 @@ "ajp_read_header: ajp_ilink_receive failed"); return rc; } - rc = ajp_msg_peek_byte(*msg, &result); + rc = ajp_msg_peek_uint8(*msg, &result); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "ajp_read_header: ajp_ilink_received %02x", result); return APR_SUCCESS; @@ -616,19 +615,19 @@ int ajp_parse_type(request_rec *r, ajp_msg_t *msg) { apr_byte_t result; - ajp_msg_peek_byte(msg, &result); + ajp_msg_peek_uint8(msg, &result); ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "ajp_parse_type: got %02x", result); return (int) result; } -/* parse the headers */ -apr_status_t ajp_parse_headers(request_rec *r, ajp_msg_t *msg) +/* parse the header */ +apr_status_t ajp_parse_header(request_rec *r, ajp_msg_t *msg) { apr_byte_t result; apr_status_t rc; - rc = ajp_msg_get_byte(msg, &result); + rc = ajp_msg_get_uint8(msg, &result); if (rc != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "ajp_parse_headers: ajp_msg_get_byte failed"); @@ -636,28 +635,28 @@ } if (result != CMD_AJP13_SEND_HEADERS) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, - "ajp_parse_headers: wrong type %02x", result); + "ajp_parse_headers: wrong type %02x expecting 0x04", result); return APR_EGENERAL; } return ajp_unmarshal_response(msg, r); } -/* parse the header and return data address and length */ -apr_status_t ajp_parse_data(request_rec *r, ajp_msg_t *msg, apr_uint16_t *len, - char **ptr) +/* parse the body and return data address and length */ +apr_status_t ajp_parse_data(request_rec *r, ajp_msg_t *msg, + apr_uint16_t *len, char **ptr) { apr_byte_t result; apr_status_t rc; - rc = ajp_msg_get_byte(msg, &result); + rc = ajp_msg_get_uint8(msg, &result); if (rc != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, "ajp_parse_data: ajp_msg_get_byte failed"); return rc; } - if (result != 3) { + if (result != CMD_AJP13_SEND_BODY_CHUNK) { ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, - "ajp_parse_data: wrong type %02x", result); + "ajp_parse_data: wrong type %02x expecting 0x03", result); return APR_EGENERAL; } rc = ajp_msg_get_uint16(msg, len); 1.29 +6 -5 jakarta-tomcat-connectors/ajp/ajplib/test/ajp.h Index: ajp.h =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/ajplib/test/ajp.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -r1.28 -r1.29 --- ajp.h 2 Aug 2004 07:07:37 -0000 1.28 +++ ajp.h 2 Aug 2004 16:35:59 -0000 1.29 @@ -271,7 +271,7 @@ * @param rvalue Pointer where value will be returned * @return APR_SUCCESS or error */ -apr_status_t ajp_msg_get_byte(ajp_msg_t *msg, apr_byte_t *rvalue); +apr_status_t ajp_msg_get_uint8(ajp_msg_t *msg, apr_byte_t *rvalue); /** * Peek a 8bits unsigned value from AJP Message, position in message @@ -281,7 +281,7 @@ * @param rvalue Pointer where value will be returned * @return APR_SUCCESS or error */ -apr_status_t ajp_msg_peek_byte(ajp_msg_t *msg, apr_byte_t *rvalue); +apr_status_t ajp_msg_peek_uint8(ajp_msg_t *msg, apr_byte_t *rvalue); /** * Get a String value from AJP Message @@ -423,14 +423,15 @@ int ajp_parse_type(request_rec *r, ajp_msg_t *msg); /** - * Parse the headers + * Parse the header message from container * @param r current request * @param msg AJP message * @return APR_SUCCESS or error */ -apr_status_t ajp_parse_headers(request_rec *r, ajp_msg_t *msg); +apr_status_t ajp_parse_header(request_rec *r, ajp_msg_t *msg); -/** parse the header and return data address and length +/** + * Parse the message body and return data address and length * @param r current request * @param msg AJP message * @param len returned AJP message length --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org