You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mt...@apache.org on 2004/09/30 17:35:45 UTC
cvs commit: httpd-2.0/modules/proxy ajp_msg.c ajp.h
mturk 2004/09/30 08:35:45
Modified: modules/proxy ajp_msg.c ajp.h
Log:
Use plain apr/apr-util for ajp.
Revision Changes Path
1.4 +16 -10 httpd-2.0/modules/proxy/ajp_msg.c
Index: ajp_msg.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/proxy/ajp_msg.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ajp_msg.c 13 Sep 2004 10:39:37 -0000 1.3
+++ ajp_msg.c 30 Sep 2004 15:35:45 -0000 1.4
@@ -21,27 +21,31 @@
/**
* Dump up to the first 1024 bytes on an AJP Message
*
+ * @param pool pool to allocate from
* @param msg AJP Message to dump
* @param err error string to display
- * @return APR_SUCCESS or error
+ * @return dump message
*/
-apr_status_t ajp_msg_dump(ajp_msg_t *msg, char *err)
+char * ajp_msg_dump(apr_pool_t *pool, ajp_msg_t *msg, char *err)
{
apr_size_t i, j;
char line[80];
char *current;
+ char *rv, *p;
+ apr_size_t bl = 8192;
apr_byte_t x;
apr_size_t len = msg->len;
/* Display only first 1024 bytes */
if (len > 1024)
len = 1024;
-
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL,
+ rv = apr_palloc(pool, bl);
+ apr_snprintf(rv, bl,
"ajp_msg_dump(): %s pos=%" APR_SIZE_T_FMT
- " len=%" APR_SIZE_T_FMT " max=%d",
+ " len=%" APR_SIZE_T_FMT " max=%d\n",
err, msg->pos, msg->len, AJP_MSG_BUFFER_SZ);
-
+ bl -= strlen(rv);
+ p = rv + strlen(rv);
for (i = 0; i < len; i += 16) {
current = line;
@@ -67,13 +71,15 @@
}
*current++ = '\0';
+ apr_snprintf(p, bl,
+ "ajp_msg_dump(): %.4lx %s\n",
+ (unsigned long)i, line);
+ bl -= strlen(rv);
+ p = rv + strlen(rv);
- ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, NULL,
- "ajp_msg_dump(): %.4lx %s",
- (unsigned long)i, line);
}
- return APR_SUCCESS;
+ return rv;
}
1.4 +3 -2 httpd-2.0/modules/proxy/ajp.h
Index: ajp.h
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/proxy/ajp.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ajp.h 17 Sep 2004 12:59:44 -0000 1.3
+++ ajp.h 30 Sep 2004 15:35:45 -0000 1.4
@@ -355,11 +355,12 @@
/**
* Dump up to the first 1024 bytes on an AJP Message
*
+ * @param pool pool to allocate from
* @param msg AJP Message to dump
* @param err error string to display
- * @return APR_SUCCESS or error
+ * @return dump message
*/
-apr_status_t ajp_msg_dump(ajp_msg_t *msg, char *err);
+char * ajp_msg_dump(apr_pool_t *pool, ajp_msg_t *msg, char *err);
/**
* Send an AJP message to backend