Author: sahan
Date: Mon Mar 20 22:19:57 2006
New Revision: 387436

URL: http://svn.apache.org/viewcvs?rev=387436&view=rev
Log:
Memory leak fixes, Fix for the break in google client, Cleanups for AXIS2C-52

Modified:
    webservices/axis2/trunk/c/modules/core/addr/endpoint_ref.c
    webservices/axis2/trunk/c/modules/core/transport/http/http_request_line.c
    webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c
    webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c
    
webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c

Modified: webservices/axis2/trunk/c/modules/core/addr/endpoint_ref.c
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/addr/endpoint_ref.c?rev=387436&r1=387435&r2=387436&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/addr/endpoint_ref.c (original)
+++ webservices/axis2/trunk/c/modules/core/addr/endpoint_ref.c Mon Mar 20 
22:19:57 2006
@@ -158,7 +158,13 @@
                                                axis2_env_t **env, axis2_char_t 
*address) 
 {
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-    AXIS2_INTF_TO_IMPL(endpoint_ref)->address = address;
+    if(NULL != AXIS2_INTF_TO_IMPL(endpoint_ref)->address)
+    {
+        AXIS2_FREE((*env)->allocator, 
AXIS2_INTF_TO_IMPL(endpoint_ref)->address);
+        AXIS2_INTF_TO_IMPL(endpoint_ref)->address = NULL;
+    }
+    
+    AXIS2_INTF_TO_IMPL(endpoint_ref)->address = AXIS2_STRDUP(address, env);
     return AXIS2_SUCCESS;
 }
 

Modified: 
webservices/axis2/trunk/c/modules/core/transport/http/http_request_line.c
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/http_request_line.c?rev=387436&r1=387435&r2=387436&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_request_line.c 
(original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_request_line.c 
Mon Mar 20 22:19:57 2006
@@ -260,7 +260,15 @@
         AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); 
         return NULL;
     }
-    sprintf(ret, "%s /%s %s%s", req_line_impl->method, req_line_impl->uri, 
+    if(req_line_impl->uri[0] != '/')
+    {
+        sprintf(ret, "%s /%s %s%s", req_line_impl->method, req_line_impl->uri, 
                     req_line_impl->http_version, AXIS2_HTTP_CRLF);
+    }
+    else
+    {
+        sprintf(ret, "%s %s %s%s", req_line_impl->method, req_line_impl->uri, 
+                    req_line_impl->http_version, AXIS2_HTTP_CRLF);
+    }
     return ret;
 }

Modified: 
webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c?rev=387436&r1=387435&r2=387436&view=diff
==============================================================================
--- 
webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c 
(original)
+++ 
webservices/axis2/trunk/c/modules/core/transport/http/http_transport_utils.c 
Mon Mar 20 22:19:57 2006
@@ -196,6 +196,7 @@
        AXIS2_MSG_CTX_SET_SERVER_SIDE(msg_ctx, env, AXIS2_TRUE);
        
        char_set = axis2_http_transport_utils_get_charset_enc(env,content_type);
+    AXIS2_FREE((*env)->allocator, content_type); 
        xml_reader = axis2_xml_reader_create_for_memory(env, 
                                                
axis2_http_transport_utils_on_data_request,NULL, 
                                                (void *)&callback_ctx, 
char_set);
@@ -772,6 +773,7 @@
        tmp = strstr(tmp_content_type, AXIS2_HTTP_CHAR_SET_ENCODING);
        if(NULL == tmp)
        {
+        AXIS2_FREE((*env)->allocator, tmp_content_type);
                return AXIS2_STRDUP(AXIS2_HTTP_HEADER_DEFAULT_CHAR_ENCODING, 
env);
        }
        tmp = strchr(tmp, '=');
@@ -782,6 +784,7 @@
        }
        if(NULL == tmp)
        {
+        AXIS2_FREE((*env)->allocator, tmp_content_type);
                return AXIS2_STRDUP(AXIS2_HTTP_HEADER_DEFAULT_CHAR_ENCODING, 
env);
        }
        tmp2 =  AXIS2_STRDUP(tmp, env);

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c?rev=387436&r1=387435&r2=387436&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c 
(original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c Mon Mar 
20 22:19:57 2006
@@ -161,6 +161,7 @@
     axis2_property_t *property = NULL;
     axis2_char_t *url_external_form = NULL;
     axis2_qname_t *tmp_qname = NULL;
+    axis2_char_t *svc_grp_uuid = NULL;
        
        AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK((*env)->error, svr_conn, AXIS2_FAILURE);
@@ -258,7 +259,13 @@
        AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, AXIS2_TRANSPORT_HEADERS, 
property, 
             AXIS2_FALSE);
 
-       AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, axis2_uuid_gen(env));
+    svc_grp_uuid = axis2_uuid_gen(env);
+       AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, svc_grp_uuid);
+    if(NULL != svc_grp_uuid)
+    {
+        AXIS2_FREE((*env)->allocator, svc_grp_uuid);
+        svc_grp_uuid = NULL;
+    }
 
     property = axis2_property_create(env);
     AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST);

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=387436&r1=387435&r2=387436&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 20 22:19:57 2006
@@ -467,20 +467,31 @@
        axis2_char_t *connection_str = NULL;
        
        AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    axis2_param_t *tmp_param = NULL;
        
-       so_str = (axis2_char_t*)AXIS2_MSG_CTX_GET_PARAMETER(msg_ctx, 
+       
+    tmp_param = AXIS2_MSG_CTX_GET_PARAMETER(msg_ctx, 
                                                env, AXIS2_HTTP_SO_TIMEOUT);
-       connection_str = (axis2_char_t*)AXIS2_MSG_CTX_GET_PARAMETER(msg_ctx, 
-                                               env, 
AXIS2_HTTP_CONNECTION_TIMEOUT);
-       if(NULL != so_str)
-       {
-               AXIS2_INTF_TO_IMPL(sender)->so_timeout = AXIS2_ATOI(so_str);
-       }
-       if(NULL != connection_str)
-       {
-               AXIS2_INTF_TO_IMPL(sender)->connection_timeout = 
AXIS2_ATOI(connection_str);
-       }
-    
+       
+    if(NULL != tmp_param)
+    {
+        so_str = (axis2_char_t*)AXIS2_PARAM_GET_VALUE(tmp_param, env);
+        if(NULL != so_str)
+        {
+            AXIS2_INTF_TO_IMPL(sender)->so_timeout = AXIS2_ATOI(so_str);
+        }
+    }
+    tmp_param = AXIS2_MSG_CTX_GET_PARAMETER(msg_ctx, env, 
+                        AXIS2_HTTP_CONNECTION_TIMEOUT);
+    if(NULL != tmp_param)
+    {
+        connection_str = (axis2_char_t*)AXIS2_PARAM_GET_VALUE(tmp_param, env);
+        if(NULL != connection_str)
+        {
+            AXIS2_INTF_TO_IMPL(sender)->connection_timeout = 
+                        AXIS2_ATOI(connection_str);
+        }
+    }
        return AXIS2_SUCCESS;
 }
 


Reply via email to