diff options
-rw-r--r-- | modules/proxy/ajp.h | 9 | ||||
-rw-r--r-- | modules/proxy/ajp_header.c | 13 | ||||
-rw-r--r-- | modules/proxy/proxy_ajp.c | 6 |
3 files changed, 10 insertions, 18 deletions
diff --git a/modules/proxy/ajp.h b/modules/proxy/ajp.h index 67c0d0b47d..5be13e0005 100644 --- a/modules/proxy/ajp.h +++ b/modules/proxy/ajp.h @@ -400,24 +400,23 @@ apr_status_t ajp_read_header(apr_socket_t *sock, /** * Allocate a msg to send data - * @param r current request + * @param pool pool to allocate from * @param ptr data buffer * @param len the length of allocated data buffer * @param msg returned AJP message * @return APR_SUCCESS or error */ -apr_status_t ajp_alloc_data_msg(request_rec *r, char **ptr, apr_size_t *len, - ajp_msg_t **msg); +apr_status_t ajp_alloc_data_msg(apr_pool_t *pool, char **ptr, + apr_size_t *len, ajp_msg_t **msg); /** * Send the data message * @param sock backend socket - * @param r current request * @param msg AJP message to send * @param len AJP message length * @return APR_SUCCESS or error */ -apr_status_t ajp_send_data_msg(apr_socket_t *sock, request_rec *r, +apr_status_t ajp_send_data_msg(apr_socket_t *sock, ajp_msg_t *msg, apr_size_t len); /** diff --git a/modules/proxy/ajp_header.c b/modules/proxy/ajp_header.c index 2a513c9098..c383f959dd 100644 --- a/modules/proxy/ajp_header.c +++ b/modules/proxy/ajp_header.c @@ -680,17 +680,13 @@ apr_status_t ajp_parse_data(request_rec *r, ajp_msg_t *msg, /* * Allocate a msg to send data */ -apr_status_t ajp_alloc_data_msg(request_rec *r, char **ptr, apr_size_t *len, +apr_status_t ajp_alloc_data_msg(apr_pool_t *pool, char **ptr, apr_size_t *len, ajp_msg_t **msg) { apr_status_t rc; - rc = ajp_msg_create(r->pool, msg); - if (rc != APR_SUCCESS) { - ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server, - "ajp_alloc_data_msg: ajp_msg_create failed"); + if ((rc = ajp_msg_create(pool, msg)) != APR_SUCCESS) return rc; - } ajp_msg_reset(*msg); *ptr = (char *)&((*msg)->buf[6]); *len = AJP_MSG_BUFFER_SZ-6; @@ -701,7 +697,7 @@ apr_status_t ajp_alloc_data_msg(request_rec *r, char **ptr, apr_size_t *len, /* * Send the data message */ -apr_status_t ajp_send_data_msg(apr_socket_t *sock, request_rec *r, +apr_status_t ajp_send_data_msg(apr_socket_t *sock, ajp_msg_t *msg, apr_size_t len) { @@ -710,9 +706,6 @@ apr_status_t ajp_send_data_msg(apr_socket_t *sock, request_rec *r, msg->len += len + 2; /* + 1 XXXX where is '\0' */ - ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, - "ajp_send_data_msg: sending %" APR_SIZE_T_FMT, len); - return ajp_ilink_send(sock, msg); } diff --git a/modules/proxy/proxy_ajp.c b/modules/proxy/proxy_ajp.c index 17aa122dd0..87d3f2e371 100644 --- a/modules/proxy/proxy_ajp.c +++ b/modules/proxy/proxy_ajp.c @@ -135,7 +135,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, } /* allocate an AJP message to store the data of the buckets */ - status = ajp_alloc_data_msg(r, &buff, &bufsiz, &msg); + status = ajp_alloc_data_msg(r->pool, &buff, &bufsiz, &msg); if (status != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: ajp_alloc_data_msg failed"); @@ -183,7 +183,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server, "proxy: got %" APR_SIZE_T_FMT " bytes of data", bufsiz); if (bufsiz > 0) { - status = ajp_send_data_msg(conn->sock, r, msg, bufsiz); + status = ajp_send_data_msg(conn->sock, msg, bufsiz); if (status != APR_SUCCESS) { apr_brigade_destroy(input_brigade); ap_log_error(APLOG_MARK, APLOG_ERR, status, r->server, @@ -243,7 +243,7 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r, } ajp_msg_reset(msg); /* will go in ajp_send_data_msg */ - status = ajp_send_data_msg(conn->sock, r, msg, bufsiz); + status = ajp_send_data_msg(conn->sock, msg, bufsiz); if (status != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_DEBUG, status, r->server, "ajp_send_data_msg failed"); |