]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Use plain apr/apr-util for ajp.
authorMladen Turk <mturk@apache.org>
Thu, 30 Sep 2004 15:35:45 +0000 (15:35 +0000)
committerMladen Turk <mturk@apache.org>
Thu, 30 Sep 2004 15:35:45 +0000 (15:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105353 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/ajp.h
modules/proxy/ajp_msg.c

index 5be13e0005ad8cb59ae392de610a807511b7123a..674a49b6e0d277f2b62226d3cddeb6ab6dd76cf2 100644 (file)
@@ -355,11 +355,12 @@ apr_status_t ajp_msg_serialize_cping(ajp_msg_t *msg);
 /**
  * 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
index 2c553d934cca911bc5c292fe93cd6c20e0125be7..19c07efea49200bcb2f4c6f57c2a761a4798a773 100644 (file)
@@ -21,27 +21,31 @@ static char *hex_table = "0123456789ABCDEF";
 /**
  * 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 @@ apr_status_t ajp_msg_dump(ajp_msg_t *msg, char *err)
         }
 
         *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;
 }