Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 3705 invoked from network); 28 Mar 2006 04:21:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Mar 2006 04:21:15 -0000 Received: (qmail 74285 invoked by uid 500); 28 Mar 2006 04:21:13 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 74200 invoked by uid 500); 28 Mar 2006 04:21:13 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 74169 invoked by uid 500); 28 Mar 2006 04:21:13 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 74154 invoked by uid 99); 28 Mar 2006 04:21:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Mar 2006 20:21:13 -0800 X-ASF-Spam-Status: No, hits=-9.4 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.29) with SMTP; Mon, 27 Mar 2006 20:21:12 -0800 Received: (qmail 3405 invoked by uid 65534); 28 Mar 2006 04:20:51 -0000 Message-ID: <20060328042051.3404.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r389390 - in /webservices/axis2/trunk/c: include/axis2_http_client.h include/axis2_msg_ctx.h modules/core/transport/http/sender/http_client.c modules/core/transport/http/sender/soap_over_http_sender.c modules/util/stream.c Date: Tue, 28 Mar 2006 04:20:50 -0000 To: axis2-cvs@ws.apache.org From: sahan@apache.org X-Mailer: svnmailer-1.0.7 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: sahan Date: Mon Mar 27 20:20:49 2006 New Revision: 389390 URL: http://svn.apache.org/viewcvs?rev=389390&view=rev Log: Cleaning http_client mem leak Modified: webservices/axis2/trunk/c/include/axis2_http_client.h webservices/axis2/trunk/c/include/axis2_msg_ctx.h webservices/axis2/trunk/c/modules/core/transport/http/sender/http_client.c webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c webservices/axis2/trunk/c/modules/util/stream.c Modified: webservices/axis2/trunk/c/include/axis2_http_client.h URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_http_client.h?rev=389390&r1=389389&r2=389390&view=diff ============================================================================== --- webservices/axis2/trunk/c/include/axis2_http_client.h (original) +++ webservices/axis2/trunk/c/include/axis2_http_client.h Mon Mar 27 20:20:49 2006 @@ -87,6 +87,14 @@ AXIS2_DECLARE(axis2_http_client_t *) axis2_http_client_create (axis2_env_t **env, axis2_url_t *url); +/** + * Free http_client passed as void pointer. This will be + * cast into appropriate type and then pass the cast object + * into the http_client structure's free method + */ +axis2_status_t AXIS2_CALL +axis2_http_client_free_void_arg (void *client, axis2_env_t **env); + /************************** Start of function macros **************************/ #define AXIS2_HTTP_CLIENT_SEND(client, env, request) \ @@ -106,7 +114,6 @@ ((client)->ops->get_url(client, env)) #define AXIS2_HTTP_CLIENT_FREE(client, env) \ ((client)->ops->free(client, env)) - /************************** End of function macros ****************************/ /** @} */ Modified: webservices/axis2/trunk/c/include/axis2_msg_ctx.h URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/include/axis2_msg_ctx.h?rev=389390&r1=389389&r2=389390&view=diff ============================================================================== --- webservices/axis2/trunk/c/include/axis2_msg_ctx.h (original) +++ webservices/axis2/trunk/c/include/axis2_msg_ctx.h Mon Mar 27 20:20:49 2006 @@ -58,6 +58,8 @@ #define AXIS2_DEFAULT_CHAR_SET_ENCODING "UTF-8" /** axis2 transport succeeded */ #define AXIS2_TRANSPORT_SUCCEED "AXIS2_TRANSPORT_SUCCEED" +/* HTTP Client */ +#define AXIS2_HTTP_CLIENT "AXIS2_HTTP_CLIENT" #define AXIS2_TRANSPORT_URL "TransportURL" Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/http_client.c URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/sender/http_client.c?rev=389390&r1=389389&r2=389390&view=diff ============================================================================== --- webservices/axis2/trunk/c/modules/core/transport/http/sender/http_client.c (original) +++ webservices/axis2/trunk/c/modules/core/transport/http/sender/http_client.c Mon Mar 27 20:20:49 2006 @@ -53,21 +53,28 @@ int AXIS2_CALL axis2_http_client_recieve_header (axis2_http_client_t *client, axis2_env_t **env); + axis2_http_simple_response_t* AXIS2_CALL axis2_http_client_get_response (axis2_http_client_t *client, axis2_env_t **env); + axis2_status_t AXIS2_CALL axis2_http_client_set_url (axis2_http_client_t *client, axis2_env_t **env, axis2_url_t *url); axis2_url_t* AXIS2_CALL axis2_http_client_get_url (axis2_http_client_t *client, axis2_env_t **env); + axis2_status_t AXIS2_CALL axis2_http_client_set_timeout (axis2_http_client_t *client, axis2_env_t **env, int timeout_ms); + int AXIS2_CALL axis2_http_client_get_timeout (axis2_http_client_t *client, axis2_env_t **env); axis2_status_t AXIS2_CALL -axis2_http_client_free (axis2_http_client_t *client, axis2_env_t **env); +axis2_http_client_free (axis2_http_client_t *client, axis2_env_t **env); + +axis2_status_t AXIS2_CALL +axis2_http_client_free_void_arg (void *client, axis2_env_t **env); /***************************** End of function headers ************************/ @@ -131,11 +138,6 @@ AXIS2_URL_FREE(http_client_impl->url, env); http_client_impl->url = NULL; } - if(NULL != http_client_impl->data_stream) - { - AXIS2_STREAM_FREE(http_client_impl->data_stream, env); - http_client_impl->data_stream = NULL; - } if(NULL != http_client_impl->response) { AXIS2_HTTP_SIMPLE_RESPONSE_FREE(http_client_impl->response, env); @@ -151,6 +153,16 @@ AXIS2_FREE((*env)->allocator, AXIS2_INTF_TO_IMPL(client)); return AXIS2_SUCCESS; +} + +axis2_status_t AXIS2_CALL +axis2_http_client_free_void_arg (void *client, axis2_env_t **env) +{ + axis2_http_client_t *client_l = NULL; + AXIS2_ENV_CHECK(env, AXIS2_FAILURE); + + client_l = (axis2_http_client_t *)client; + return axis2_http_client_free(client_l, env); } Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c?rev=389390&r1=389389&r2=389390&view=diff ============================================================================== --- webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c (original) +++ webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c Mon Mar 27 20:20:49 2006 @@ -158,6 +158,10 @@ if(NULL != sender->ops) AXIS2_FREE((*env)->allocator, sender->ops); + /* Do not free this here since it will be required in later processing + * of the response soap message + */ + sender_impl->client = NULL; AXIS2_FREE((*env)->allocator, sender_impl); return AXIS2_SUCCESS; } @@ -207,6 +211,16 @@ { return AXIS2_FAILURE; } + /* We put the client into msg_ctx so that we can free it once the processing + * is done at client side + */ + property = axis2_property_create(env); + AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST); + AXIS2_PROPERTY_SET_FREE_FUNC(property, env, + axis2_http_client_free_void_arg); + AXIS2_PROPERTY_SET_VALUE(property, env, sender_impl->client); + AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, AXIS2_HTTP_CLIENT, + property, AXIS2_TRUE); if(NULL == sender_impl->om_output) { Modified: webservices/axis2/trunk/c/modules/util/stream.c URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/stream.c?rev=389390&r1=389389&r2=389390&view=diff ============================================================================== --- webservices/axis2/trunk/c/modules/util/stream.c (original) +++ webservices/axis2/trunk/c/modules/util/stream.c Mon Mar 27 20:20:49 2006 @@ -44,6 +44,10 @@ axis2_status_t AXIS2_CALL axis2_stream_free (axis2_stream_t *stream, axis2_env_t **env); +axis2_status_t AXIS2_CALL +axis2_stream_free_void_arg (void *stream, + axis2_env_t **env); + axis2_stream_type_t AXIS2_CALL axis2_stream_get_type (axis2_stream_t *stream, axis2_env_t **env);