You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by mt...@apache.org on 2004/08/02 18:36:00 UTC
cvs commit: jakarta-tomcat-connectors/ajp/ajplib/test ajp_msg.c ajp_header.c ajp.h
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