axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject svn commit: r805347 [23/31] - in /webservices/axis2/trunk/c/src: core/addr/ core/clientapi/ core/context/ core/deployment/ core/description/ core/engine/ core/phaseresolver/ core/receivers/ core/transport/amqp/receiver/ core/transport/amqp/receiver/qpi...
Date Tue, 18 Aug 2009 10:15:53 GMT
Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/http_transport_sender.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/http_transport_sender.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/http_transport_sender.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/http_transport_sender.c Tue Aug 18 10:15:49 2009
@@ -50,33 +50,35 @@
 #ifdef AXIS2_LIBCURL_ENABLED
     axis2_libcurl_t *libcurl;
 #endif
-}
-axis2_http_transport_sender_impl_t;
+} axis2_http_transport_sender_impl_t;
 
 #define AXIS2_WS_RM_ANONYMOUS_URL "http://docs.oasis-open.org/ws-rx/wsmc/200702/anonymous?id="
-
 #define AXIS2_INTF_TO_IMPL(transport_sender) \
                          ((axis2_http_transport_sender_impl_t *)\
                      (transport_sender))
 
 /***************************** Function headers *******************************/
-axis2_status_t AXIS2_CALL axis2_http_transport_sender_invoke(
+axis2_status_t AXIS2_CALL
+axis2_http_transport_sender_invoke(
     axis2_transport_sender_t * transport_sender,
     const axutil_env_t * env,
     axis2_msg_ctx_t * msg_ctx);
 
-axis2_status_t AXIS2_CALL axis2_http_transport_sender_clean_up(
+axis2_status_t AXIS2_CALL
+axis2_http_transport_sender_clean_up(
     axis2_transport_sender_t * transport_sender,
     const axutil_env_t * env,
     axis2_msg_ctx_t * msg_ctx);
 
-axis2_status_t AXIS2_CALL axis2_http_transport_sender_init(
+axis2_status_t AXIS2_CALL
+axis2_http_transport_sender_init(
     axis2_transport_sender_t * transport_sender,
     const axutil_env_t * env,
     axis2_conf_ctx_t * conf_ctx,
     axis2_transport_out_desc_t * out_desc);
 
-axis2_status_t AXIS2_CALL axis2_http_transport_sender_write_message(
+axis2_status_t AXIS2_CALL
+axis2_http_transport_sender_write_message(
     axis2_transport_sender_t * transport_sender,
     const axutil_env_t * env,
     axis2_msg_ctx_t * msg_ctx,
@@ -89,11 +91,8 @@
     const axutil_env_t * env);
 
 static const axis2_transport_sender_ops_t http_transport_sender_ops_var = {
-    axis2_http_transport_sender_init,
-    axis2_http_transport_sender_invoke,
-    axis2_http_transport_sender_clean_up,
-    axis2_http_transport_sender_free
-};
+    axis2_http_transport_sender_init, axis2_http_transport_sender_invoke,
+    axis2_http_transport_sender_clean_up, axis2_http_transport_sender_free };
 
 axis2_transport_sender_t *AXIS2_CALL
 axis2_http_transport_sender_create(
@@ -101,24 +100,21 @@
 {
     axis2_http_transport_sender_impl_t *transport_sender_impl = NULL;
 
-    transport_sender_impl = (axis2_http_transport_sender_impl_t *) AXIS2_MALLOC
-        (env->allocator, sizeof(axis2_http_transport_sender_impl_t));
+    transport_sender_impl = (axis2_http_transport_sender_impl_t *)AXIS2_MALLOC(env->allocator,
+        sizeof(axis2_http_transport_sender_impl_t));
 
-    if (!transport_sender_impl)
+    if(!transport_sender_impl)
     {
         AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    memset ((void *)transport_sender_impl, 0, sizeof (axis2_http_transport_sender_impl_t));
+    memset((void *)transport_sender_impl, 0, sizeof(axis2_http_transport_sender_impl_t));
 
-    transport_sender_impl->http_version =
-        axutil_strdup(env, AXIS2_HTTP_HEADER_PROTOCOL_11);
+    transport_sender_impl->http_version = axutil_strdup(env, AXIS2_HTTP_HEADER_PROTOCOL_11);
     transport_sender_impl->chunked = AXIS2_TRUE;
-    transport_sender_impl->connection_timeout =
-        AXIS2_HTTP_DEFAULT_CONNECTION_TIMEOUT;
+    transport_sender_impl->connection_timeout = AXIS2_HTTP_DEFAULT_CONNECTION_TIMEOUT;
     transport_sender_impl->so_timeout = AXIS2_HTTP_DEFAULT_SO_TIMEOUT;
-    transport_sender_impl->transport_sender.ops =
-        &http_transport_sender_ops_var;
+    transport_sender_impl->transport_sender.ops = &http_transport_sender_ops_var;
 
 #ifdef AXIS2_LIBCURL_ENABLED
     transport_sender_impl->libcurl = axis2_libcurl_create(env);
@@ -138,16 +134,16 @@
     axis2_transport_sender_t * transport_sender,
     const axutil_env_t * env)
 {
-	
+
     axis2_http_transport_sender_impl_t *transport_sender_impl = NULL;
-    if (!transport_sender)
+    if(!transport_sender)
     {
         return;
     }
 
     transport_sender_impl = AXIS2_INTF_TO_IMPL(transport_sender);
 
-    if (transport_sender_impl->http_version)
+    if(transport_sender_impl->http_version)
     {
         AXIS2_FREE(env->allocator, transport_sender_impl->http_version);
         transport_sender_impl->http_version = NULL;
@@ -191,27 +187,25 @@
     axis2_bool_t write_xml_declaration = AXIS2_FALSE;
     axis2_bool_t fault = AXIS2_FALSE;
 
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
-        "Entry:axis2_http_transport_sender_invoke");
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Entry:axis2_http_transport_sender_invoke");
     AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
 
     char_set_enc_str = axis2_msg_ctx_get_charset_encoding(msg_ctx, env);
-    if (char_set_enc_str)
+    if(char_set_enc_str)
     {
         char_set_enc = axutil_string_get_buffer(char_set_enc_str, env);
     }
 
-    if (!char_set_enc)
+    if(!char_set_enc)
     {
         axis2_op_ctx_t *op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
-        if (op_ctx)
+        if(op_ctx)
         {
             axis2_ctx_t *ctx = axis2_op_ctx_get_base(op_ctx, env);
-            if (ctx)
+            if(ctx)
             {
-                property = axis2_ctx_get_property(ctx, env,
-                                                  AXIS2_CHARACTER_SET_ENCODING);
-                if (property)
+                property = axis2_ctx_get_property(ctx, env, AXIS2_CHARACTER_SET_ENCODING);
+                if(property)
                 {
                     char_set_enc = axutil_property_get_value(property, env);
                     property = NULL;
@@ -224,7 +218,7 @@
      * If we still can't find the char set enc we will
      * use default
      */
-    if (!char_set_enc)
+    if(!char_set_enc)
     {
         char_set_enc = AXIS2_DEFAULT_CHAR_SET_ENCODING;
     }
@@ -232,10 +226,9 @@
     do_mtom = axis2_http_transport_utils_do_write_mtom(env, msg_ctx);
 
     transport_url = axis2_msg_ctx_get_transport_url(msg_ctx, env);
-    if (transport_url)
+    if(transport_url)
     {
-        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "transport_url:%s", 
-            transport_url);
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "transport_url:%s", transport_url);
         epr = axis2_endpoint_ref_create(env, transport_url);
     }
     else
@@ -243,45 +236,41 @@
         /* when transport url is not available in msg_ctx */
         axis2_endpoint_ref_t *ctx_epr = axis2_msg_ctx_get_to(msg_ctx, env);
         if(ctx_epr)
-            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "ctx_epr:%s", 
-                axis2_endpoint_ref_get_address(ctx_epr, env));
+            AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "ctx_epr:%s", axis2_endpoint_ref_get_address(
+                ctx_epr, env));
 
-        if (ctx_epr && axutil_strcmp(AXIS2_WSA_ANONYMOUS_URL_SUBMISSION, axis2_endpoint_ref_get_address(
-            ctx_epr, env)) && axutil_strcmp(AXIS2_WSA_ANONYMOUS_URL, axis2_endpoint_ref_get_address(
-                ctx_epr, env)) && !(axutil_strstr(axis2_endpoint_ref_get_address(ctx_epr, env), 
-                    AXIS2_WS_RM_ANONYMOUS_URL)))
+        if(ctx_epr && axutil_strcmp(AXIS2_WSA_ANONYMOUS_URL_SUBMISSION,
+            axis2_endpoint_ref_get_address(ctx_epr, env)) && axutil_strcmp(AXIS2_WSA_ANONYMOUS_URL,
+            axis2_endpoint_ref_get_address(ctx_epr, env)) && !(axutil_strstr(
+            axis2_endpoint_ref_get_address(ctx_epr, env), AXIS2_WS_RM_ANONYMOUS_URL)))
         {
             epr = ctx_epr;
         }
     }
 
     soap_data_out = axis2_msg_ctx_get_soap_envelope(msg_ctx, env);
-    if (!soap_data_out)
+    if(!soap_data_out)
     {
-        AXIS2_HANDLE_ERROR(env,
-                           AXIS2_ERROR_NULL_SOAP_ENVELOPE_IN_MSG_CTX,
-                           AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s",
-                        AXIS2_ERROR_GET_MESSAGE(env->error));
+        AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NULL_SOAP_ENVELOPE_IN_MSG_CTX, AXIS2_FAILURE);
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "%s", AXIS2_ERROR_GET_MESSAGE(env->error));
         return AXIS2_SUCCESS;
     }
 
-    xml_writer = axiom_xml_writer_create_for_memory(env, NULL,
-                                                    AXIS2_TRUE, 0,
-                                                    AXIS2_XML_PARSER_TYPE_BUFFER);
-    if (!xml_writer)
+    xml_writer = axiom_xml_writer_create_for_memory(env, NULL, AXIS2_TRUE, 0,
+        AXIS2_XML_PARSER_TYPE_BUFFER);
+    if(!xml_writer)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                        "Could not create xml_writer for \
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Could not create xml_writer for \
 AXIS2_XML_PARSER_TYPE_BUFFER");
         return AXIS2_FAILURE;
     }
 
     om_output = axiom_output_create(env, xml_writer);
-    if (!om_output)
+    if(!om_output)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                        "Could not create om_output for xml writer of \
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+            "Could not create om_output for xml writer of \
 AXIS2_XML_PARSER_TYPE_BUFFER");
         axiom_xml_writer_free(xml_writer, env);
         xml_writer = NULL;
@@ -289,51 +278,44 @@
     }
 
     /* setting SOAP version for OM_OUTPUT.  */
-    axiom_output_set_soap11(om_output, env,
-                            axis2_msg_ctx_get_is_soap_11(msg_ctx, env));
-    
+    axiom_output_set_soap11(om_output, env, axis2_msg_ctx_get_is_soap_11(msg_ctx, env));
+
     /* This is the case where normal client send the requet using a http_client*/
-    
-    if (epr)
+
+    if(epr)
     {
-        if (axutil_strcmp
-            (AXIS2_WSA_NONE_URL_SUBMISSION,
-             axis2_endpoint_ref_get_address(epr, env)) == 0 ||
-            axutil_strcmp(AXIS2_WSA_NONE_URL,
-                          axis2_endpoint_ref_get_address(epr, env)) == 0)
+        if(axutil_strcmp(AXIS2_WSA_NONE_URL_SUBMISSION, axis2_endpoint_ref_get_address(epr, env))
+            == 0 || axutil_strcmp(AXIS2_WSA_NONE_URL, axis2_endpoint_ref_get_address(epr, env))
+            == 0)
         {
             epr = NULL;
         }
         else
         {
-            status = axis2_http_transport_sender_write_message(transport_sender, env,
-                                                               msg_ctx, epr,
-                                                               soap_data_out, om_output);
+            status = axis2_http_transport_sender_write_message(transport_sender, env, msg_ctx, epr,
+                soap_data_out, om_output);
         }
     }
 
     /* If no endpoint reference could be derived from the the message context. It could well be the
      * single channel two way scenario in the application server side send.
      */
-    if (!epr)
+    if(!epr)
     {
-        axutil_stream_t *out_stream =
-            axis2_msg_ctx_get_transport_out_stream(msg_ctx, env);
+        axutil_stream_t *out_stream = axis2_msg_ctx_get_transport_out_stream(msg_ctx, env);
 
-        if (AXIS2_TRUE == axis2_msg_ctx_get_server_side(msg_ctx, env))
+        if(AXIS2_TRUE == axis2_msg_ctx_get_server_side(msg_ctx, env))
         {
             axis2_http_out_transport_info_t *out_info = NULL;
             axis2_bool_t is_soap11 = AXIS2_FALSE;
             axis2_op_ctx_t *op_ctx = NULL;
 
-            out_info = (axis2_http_out_transport_info_t *)
-                axis2_msg_ctx_get_out_transport_info(msg_ctx, env);
+            out_info = (axis2_http_out_transport_info_t *)axis2_msg_ctx_get_out_transport_info(
+                msg_ctx, env);
 
-            if (!out_info)
+            if(!out_info)
             {
-                AXIS2_HANDLE_ERROR(env,
-                                AXIS2_ERROR_OUT_TRNSPORT_INFO_NULL,
-                                AXIS2_FAILURE);
+                AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_OUT_TRNSPORT_INFO_NULL, AXIS2_FAILURE);
                 axiom_output_free(om_output, env);
                 om_output = NULL;
                 xml_writer = NULL;
@@ -342,116 +324,107 @@
 
             is_soap11 = axis2_msg_ctx_get_is_soap_11(msg_ctx, env);
 
-            AXIS2_HTTP_OUT_TRANSPORT_INFO_SET_CHAR_ENCODING(out_info, env,
-                                                            char_set_enc);
-            if (AXIS2_TRUE == is_soap11)
+            AXIS2_HTTP_OUT_TRANSPORT_INFO_SET_CHAR_ENCODING(out_info, env, char_set_enc);
+            if(AXIS2_TRUE == is_soap11)
             {
                 /* SOAP1.1 */
                 AXIS2_HTTP_OUT_TRANSPORT_INFO_SET_CONTENT_TYPE(out_info, env,
-                                                               AXIS2_HTTP_HEADER_ACCEPT_TEXT_XML);
+                    AXIS2_HTTP_HEADER_ACCEPT_TEXT_XML);
             }
             else
             {
                 /* SOAP1.2 */
                 AXIS2_HTTP_OUT_TRANSPORT_INFO_SET_CONTENT_TYPE(out_info, env,
-                                                               AXIS2_HTTP_HEADER_ACCEPT_APPL_SOAP);
+                    AXIS2_HTTP_HEADER_ACCEPT_APPL_SOAP);
             }
 
-            conf_ctx = axis2_msg_ctx_get_conf_ctx (msg_ctx, env);
-            if (conf_ctx)
+            conf_ctx = axis2_msg_ctx_get_conf_ctx(msg_ctx, env);
+            if(conf_ctx)
             {
-                conf = axis2_conf_ctx_get_conf (conf_ctx, env);
+                conf = axis2_conf_ctx_get_conf(conf_ctx, env);
             }
 
-            if (conf)
+            if(conf)
             {
                 /* get access to HTTP transport for sending */
-                trans_desc = axis2_conf_get_transport_out (conf,
-                                                           env, 
-                                                           AXIS2_TRANSPORT_ENUM_HTTP);
+                trans_desc = axis2_conf_get_transport_out(conf, env, AXIS2_TRANSPORT_ENUM_HTTP);
             }
 
-            if (trans_desc)
+            if(trans_desc)
             {
 
                 /* accessing parameter in axis2.xml which set to have
                  * an ability to send xml versoin processing
                  * instruction <?xml version = "1.0"?> */
-                write_xml_declaration_param =
-                    axutil_param_container_get_param
-                    (axis2_transport_out_desc_param_container (trans_desc, env), env,
-                     AXIS2_XML_DECLARATION);
+                write_xml_declaration_param = axutil_param_container_get_param(
+                    axis2_transport_out_desc_param_container(trans_desc, env), env,
+                    AXIS2_XML_DECLARATION);
             }
 
-            if (write_xml_declaration_param)
+            if(write_xml_declaration_param)
             {
-                transport_attrs = axutil_param_get_attributes 
-                    (write_xml_declaration_param, env);
-                if (transport_attrs)
+                transport_attrs = axutil_param_get_attributes(write_xml_declaration_param, env);
+                if(transport_attrs)
                 {
                     /* Accessing attribute values */
                     axutil_generic_obj_t *obj = NULL;
                     axiom_attribute_t *write_xml_declaration_attr = NULL;
                     axis2_char_t *write_xml_declaration_attr_value = NULL;
 
-                    obj = axutil_hash_get (transport_attrs, AXIS2_ADD_XML_DECLARATION,
-                                           AXIS2_HASH_KEY_STRING);
-                    if (obj)
+                    obj = axutil_hash_get(transport_attrs, AXIS2_ADD_XML_DECLARATION,
+                        AXIS2_HASH_KEY_STRING);
+                    if(obj)
                     {
-                        write_xml_declaration_attr = (axiom_attribute_t *) 
-                            axutil_generic_obj_get_value (obj,env);
+                        write_xml_declaration_attr
+                            = (axiom_attribute_t *)axutil_generic_obj_get_value(obj, env);
                     }
 
-                    if (write_xml_declaration_attr)
+                    if(write_xml_declaration_attr)
                     {
-                        write_xml_declaration_attr_value = axiom_attribute_get_value 
-                            (write_xml_declaration_attr, env);
+                        write_xml_declaration_attr_value = axiom_attribute_get_value(
+                            write_xml_declaration_attr, env);
                     }
 
-                    if (write_xml_declaration_attr_value && 
-                        0 == axutil_strcasecmp (write_xml_declaration_attr_value, 
-                                                AXIS2_VALUE_TRUE))
+                    if(write_xml_declaration_attr_value && 0 == axutil_strcasecmp(
+                        write_xml_declaration_attr_value, AXIS2_VALUE_TRUE))
                     {
                         write_xml_declaration = AXIS2_TRUE;
                     }
                 }
             }
 
-            if (write_xml_declaration)
+            if(write_xml_declaration)
             {
-                axiom_output_write_xml_version_encoding (om_output, env);
+                axiom_output_write_xml_version_encoding(om_output, env);
             }
 
-
-            if (AXIS2_TRUE == axis2_msg_ctx_get_doing_rest(msg_ctx, env))
+            if(AXIS2_TRUE == axis2_msg_ctx_get_doing_rest(msg_ctx, env))
             {
                 axiom_node_t *body_node = NULL;
                 /* axis2_bool_t fault = AXIS2_FALSE;*/
                 axiom_soap_fault_t *soap_fault;
-                axiom_soap_body_t *soap_body =
-                    axiom_soap_envelope_get_body(soap_data_out, env);
+                axiom_soap_body_t *soap_body = axiom_soap_envelope_get_body(soap_data_out, env);
                 axiom_soap_fault_detail_t *soap_fault_detial;
 
-                if (!soap_body)
+                if(!soap_body)
                 {
-                    AXIS2_HANDLE_ERROR(env,
-                                    AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL,
-                                    AXIS2_FAILURE);
+                    AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL,
+                        AXIS2_FAILURE);
                     axiom_output_free(om_output, env);
                     om_output = NULL;
                     xml_writer = NULL;
                     return AXIS2_FAILURE;
                 }
-                
-                fault = axiom_soap_body_has_fault (soap_body, env);
-                
-                if (fault == AXIS2_TRUE)
+
+                fault = axiom_soap_body_has_fault(soap_body, env);
+
+                if(fault == AXIS2_TRUE)
                 {
-                    soap_fault = axiom_soap_body_get_fault (soap_body, env);
+                    soap_fault = axiom_soap_body_get_fault(soap_body, env);
 
-                    if (!soap_fault)
+                    if(!soap_fault)
                     {
-                        
+
                         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
                             "Rest fault has occur, error described below");
                         axiom_output_free(om_output, env);
@@ -460,25 +433,25 @@
                         return AXIS2_FAILURE;
                     }
 
-                    soap_fault_detial = axiom_soap_fault_get_detail (soap_fault, env);
+                    soap_fault_detial = axiom_soap_fault_get_detail(soap_fault, env);
 
-                    if (!soap_fault_detial)
+                    if(!soap_fault_detial)
                     {
                         axiom_output_free(om_output, env);
                         om_output = NULL;
                         xml_writer = NULL;
-                        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+                        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
                             "Returning failure to obtain soap_fault_detail from soap_fault");
                         return AXIS2_FAILURE;
                     }
 
                     body_node = axiom_soap_fault_detail_get_base_node(soap_fault_detial, env);
-                    if (!body_node)
+                    if(!body_node)
                     {
                         axiom_output_free(om_output, env);
                         om_output = NULL;
                         xml_writer = NULL;
-                        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+                        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
                             "failure to get base node from soap_fault_detail.");
                         return AXIS2_FAILURE;
                     }
@@ -488,56 +461,52 @@
                 {
 
                     body_node = axiom_soap_body_get_base_node(soap_body, env);
-                    if (!body_node)
+                    if(!body_node)
                     {
                         axiom_output_free(om_output, env);
                         om_output = NULL;
                         xml_writer = NULL;
-                        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
+                        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
                             "failure to get base node from soap_body.");
                         return AXIS2_FAILURE;
                     }
                 }
-             
+
                 data_out = axiom_node_get_first_element(body_node, env);
 
-                if (!data_out || 
-                    axiom_node_get_node_type(data_out, env)!= AXIOM_ELEMENT) 
+                if(!data_out || axiom_node_get_node_type(data_out, env) != AXIOM_ELEMENT)
                 {
                     axiom_output_free(om_output, env);
                     om_output = NULL;
                     xml_writer = NULL;
-                    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, 
-                                    "unable to get first element from soap_body, base node.");
+                    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+                        "unable to get first element from soap_body, base node.");
                     return AXIS2_FAILURE;
                 }
 
                 axiom_node_serialize(data_out, env, om_output);
-                buffer =
-                    (axis2_char_t *) axiom_xml_writer_get_xml(xml_writer, env);
+                buffer = (axis2_char_t *)axiom_xml_writer_get_xml(xml_writer, env);
                 buffer_size = axiom_xml_writer_get_xml_size(xml_writer, env);
                 axutil_stream_write(out_stream, env, buffer, buffer_size);
                 /* Finish Rest Processing */
-                
+
             }
             else
             {
                 axiom_soap_body_t *body = NULL;
 
-
                 body = axiom_soap_envelope_get_body(soap_data_out, env);
-                fault = axiom_soap_body_has_fault (body, env);
+                fault = axiom_soap_body_has_fault(body, env);
 
                 /* SOAP Processing */
                 axiom_output_set_do_optimize(om_output, env, do_mtom);
-                axiom_soap_envelope_serialize(soap_data_out, env, om_output,
-                                              AXIS2_FALSE);
-                if (do_mtom && !fault)
+                axiom_soap_envelope_serialize(soap_data_out, env, om_output, AXIS2_FALSE);
+                if(do_mtom && !fault)
                 {
                     axis2_status_t mtom_status = AXIS2_FAILURE;
                     axis2_char_t *content_type = NULL;
                     axutil_array_list_t *mime_parts = NULL;
-                   
+
                     /*Create the attachment related data and put them to an
                      *array_list */
                     mtom_status = axiom_output_flush(om_output, env);
@@ -546,8 +515,8 @@
                         mime_parts = axiom_output_get_mime_parts(om_output, env);
                         if(!mime_parts)
                         {
-                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                            "Unable to create the mime_part list from om_output");
+                            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                                "Unable to create the mime_part list from om_output");
                             return AXIS2_FAILURE;
                         }
                         else
@@ -556,16 +525,12 @@
                         }
                     }
                     /*om_out put has the details of content_type */
-                    content_type =
-                        (axis2_char_t *)
-                        axiom_output_get_content_type(om_output, env);
-                    AXIS2_HTTP_OUT_TRANSPORT_INFO_SET_CONTENT_TYPE(out_info,
-                                                                   env,
-                                                                   content_type);
+                    content_type = (axis2_char_t *)axiom_output_get_content_type(om_output, env);
+                    AXIS2_HTTP_OUT_TRANSPORT_INFO_SET_CONTENT_TYPE(out_info, env, content_type);
                 }
                 else
                 {
-                    buffer = (axis2_char_t *) axiom_xml_writer_get_xml(xml_writer, env);
+                    buffer = (axis2_char_t *)axiom_xml_writer_get_xml(xml_writer, env);
                     buffer_size = axiom_xml_writer_get_xml_size(xml_writer, env);
 
                     /* This is where it actually fill the buffer in out_stream. In application server
@@ -585,16 +550,15 @@
     om_output = NULL;
     xml_writer = NULL;
 
-    if (transport_url)
+    if(transport_url)
     {
-        if (epr)
+        if(epr)
         {
             axis2_endpoint_ref_free(epr, env);
             epr = NULL;
         }
     }
-    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, 
-        "Exit:axis2_http_transport_sender_invoke");
+    AXIS2_LOG_TRACE(env->log, AXIS2_LOG_SI, "Exit:axis2_http_transport_sender_invoke");
     return status;
 }
 
@@ -630,45 +594,38 @@
     AXIS2_PARAM_CHECK(env->error, transport_sender, AXIS2_FAILURE);
 
     /* Getting HTTP version from axis2.xml */
-    version_param =
-        axutil_param_container_get_param
-        (axis2_transport_out_desc_param_container(out_desc, env), env,
-         AXIS2_HTTP_PROTOCOL_VERSION);
-
+    version_param = axutil_param_container_get_param(axis2_transport_out_desc_param_container(
+        out_desc, env), env, AXIS2_HTTP_PROTOCOL_VERSION);
 
-    if (version_param)
+    if(version_param)
     {
         version = axutil_param_get_value(version_param, env);
     }
 
-
-    if (version)
+    if(version)
     {
         /* handling HTTP 1.1 */
-        if (0 == axutil_strcmp(version, AXIS2_HTTP_HEADER_PROTOCOL_11))
+        if(0 == axutil_strcmp(version, AXIS2_HTTP_HEADER_PROTOCOL_11))
         {
             axis2_char_t *encoding = NULL;
             axutil_param_t *encoding_param = NULL;
-            if (AXIS2_INTF_TO_IMPL(transport_sender)->http_version)
+            if(AXIS2_INTF_TO_IMPL(transport_sender)->http_version)
             {
-                AXIS2_FREE(env->allocator,
-                           AXIS2_INTF_TO_IMPL(transport_sender)->http_version);
+                AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(transport_sender)->http_version);
             }
 
-            AXIS2_INTF_TO_IMPL(transport_sender)->http_version =
-                axutil_strdup(env, version);
-            encoding_param =
-                axutil_param_container_get_param
-                (axis2_transport_out_desc_param_container(out_desc, env), env,
-                 AXIS2_HTTP_HEADER_TRANSFER_ENCODING);
+            AXIS2_INTF_TO_IMPL(transport_sender)->http_version = axutil_strdup(env, version);
+            encoding_param = axutil_param_container_get_param(
+                axis2_transport_out_desc_param_container(out_desc, env), env,
+                AXIS2_HTTP_HEADER_TRANSFER_ENCODING);
 
-            if (encoding_param)
+            if(encoding_param)
             {
                 encoding = axutil_param_get_value(encoding_param, env);
             }
 
-            if (encoding && 0 == axutil_strcmp(encoding,
-                                               AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED))
+            if(encoding && 0
+                == axutil_strcmp(encoding, AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED))
             {
                 AXIS2_INTF_TO_IMPL(transport_sender)->chunked = AXIS2_TRUE;
             }
@@ -678,59 +635,52 @@
             }
 
         }
-        else if (0 == axutil_strcmp(version, AXIS2_HTTP_HEADER_PROTOCOL_10))
+        else if(0 == axutil_strcmp(version, AXIS2_HTTP_HEADER_PROTOCOL_10))
         {
             /* Handling HTTP 1.0 */
-            if (AXIS2_INTF_TO_IMPL(transport_sender)->http_version)
+            if(AXIS2_INTF_TO_IMPL(transport_sender)->http_version)
             {
-                AXIS2_FREE(env->allocator,
-                           AXIS2_INTF_TO_IMPL(transport_sender)->http_version);
+                AXIS2_FREE(env->allocator, AXIS2_INTF_TO_IMPL(transport_sender)->http_version);
             }
-            AXIS2_INTF_TO_IMPL(transport_sender)->http_version =
-                axutil_strdup(env, version);
+            AXIS2_INTF_TO_IMPL(transport_sender)->http_version = axutil_strdup(env, version);
             AXIS2_INTF_TO_IMPL(transport_sender)->chunked = AXIS2_FALSE;
         }
     }
     else
     {
         /* HTTP version is not available in axis2.xml */
-        AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NULL_HTTP_VERSION,
-                        AXIS2_FAILURE);
+        AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NULL_HTTP_VERSION, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
 
     /* Getting HTTP_SO_TIMEOUT value from axis2.xml */
-    temp_param =
-        axutil_param_container_get_param
-        (axis2_transport_out_desc_param_container(out_desc, env), env,
-         AXIS2_HTTP_SO_TIMEOUT);
+    temp_param = axutil_param_container_get_param(axis2_transport_out_desc_param_container(
+        out_desc, env), env, AXIS2_HTTP_SO_TIMEOUT);
 
-    if (temp_param)
+    if(temp_param)
     {
         temp = axutil_param_get_value(temp_param, env);
     }
 
-    if (temp)
+    if(temp)
     {
         AXIS2_INTF_TO_IMPL(transport_sender)->so_timeout = AXIS2_ATOI(temp);
     }
 
     /* Getting HTTP_CONNECTION_TIMEOUT from axis2.xml */
-    temp =
-        (axis2_char_t *)
-        axutil_param_container_get_param
-        (axis2_transport_out_desc_param_container(out_desc, env), env,
-         AXIS2_HTTP_CONNECTION_TIMEOUT);
-    if (temp_param)
+    temp
+        = (axis2_char_t *)axutil_param_container_get_param(
+            axis2_transport_out_desc_param_container(out_desc, env), env,
+            AXIS2_HTTP_CONNECTION_TIMEOUT);
+    if(temp_param)
     {
         temp = axutil_param_get_value(temp_param, env);
     }
 
     /* set axis2.xml connection timeout value to http_sender */
-    if (temp)
+    if(temp)
     {
-        AXIS2_INTF_TO_IMPL(transport_sender)->connection_timeout =
-            AXIS2_ATOI(temp);
+        AXIS2_INTF_TO_IMPL(transport_sender)->connection_timeout = AXIS2_ATOI(temp);
     }
 
     return AXIS2_SUCCESS;
@@ -762,20 +712,18 @@
     /* epr is already passed NULL checking */
     url = axis2_endpoint_ref_get_address(epr, env);
 
-    soap_action =
-        axutil_string_get_buffer(axis2_msg_ctx_get_soap_action(msg_ctx, env),
-                                 env);
+    soap_action = axutil_string_get_buffer(axis2_msg_ctx_get_soap_action(msg_ctx, env), env);
 
-    if (!soap_action)
+    if(!soap_action)
     {
         soap_action = "";
     }
 
     sender = axis2_http_sender_create(env);
 
-    if (!sender)
+    if(!sender)
     {
-        AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "http sender creation failed");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "http sender creation failed");
         return AXIS2_FAILURE;
     }
 
@@ -785,12 +733,11 @@
     if(axis2_msg_ctx_get_doing_mtom(msg_ctx, env))
     {
         AXIS2_HTTP_SENDER_SET_CHUNKED(sender, env, AXIS2_TRUE);
-        AXIS2_HTTP_SENDER_SET_HTTP_VERSION(sender, env, AXIS2_HTTP_HEADER_PROTOCOL_11);        
+        AXIS2_HTTP_SENDER_SET_HTTP_VERSION(sender, env, AXIS2_HTTP_HEADER_PROTOCOL_11);
     }
     else
     {
-        AXIS2_HTTP_SENDER_SET_CHUNKED(sender, env,
-            AXIS2_INTF_TO_IMPL(transport_sender)->chunked);
+        AXIS2_HTTP_SENDER_SET_CHUNKED(sender, env, AXIS2_INTF_TO_IMPL(transport_sender)->chunked);
         AXIS2_HTTP_SENDER_SET_HTTP_VERSION(sender, env,
             AXIS2_INTF_TO_IMPL(transport_sender)->http_version);
     }
@@ -799,31 +746,28 @@
 #ifdef AXIS2_LIBCURL_ENABLED
     AXIS2_LOG_DEBUG (env->log, AXIS2_LOG_SI, "using axis2 libcurl http sender.");
     status =
-        axis2_libcurl_http_send(AXIS2_INTF_TO_IMPL(transport_sender)->libcurl,
-                                sender, env, msg_ctx, out, url, soap_action);
+    axis2_libcurl_http_send(AXIS2_INTF_TO_IMPL(transport_sender)->libcurl,
+        sender, env, msg_ctx, out, url, soap_action);
 #else
-    AXIS2_LOG_DEBUG (env->log, AXIS2_LOG_SI, "using axis2 native http sender.");
-    status =
-        AXIS2_HTTP_SENDER_SEND(sender, env, msg_ctx, out, url, soap_action);
+    AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "using axis2 native http sender.");
+    status = AXIS2_HTTP_SENDER_SEND(sender, env, msg_ctx, out, url, soap_action);
 #endif
 
     AXIS2_HTTP_SENDER_FREE(sender, env);
     sender = NULL;
 
     /* if the send was not successful, do not process any response */
-    if (status != AXIS2_SUCCESS)
+    if(status != AXIS2_SUCCESS)
         return status;
 
     op = axis2_msg_ctx_get_op(msg_ctx, env);
-    if (op)
+    if(op)
     {
         /* handle one way case */
         const axis2_char_t *mep = axis2_op_get_msg_exchange_pattern(op, env);
-        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
-                        "OP name axutil_qname_get_localpart = %s", mep);
-        if (axutil_strcmp(mep, AXIS2_MEP_URI_OUT_ONLY) == 0 ||
-            axutil_strcmp(mep, AXIS2_MEP_URI_ROBUST_OUT_ONLY) == 0 ||
-            axutil_strcmp(mep, AXIS2_MEP_URI_IN_ONLY) == 0)
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "OP name axutil_qname_get_localpart = %s", mep);
+        if(axutil_strcmp(mep, AXIS2_MEP_URI_OUT_ONLY) == 0 || axutil_strcmp(mep,
+            AXIS2_MEP_URI_ROBUST_OUT_ONLY) == 0 || axutil_strcmp(mep, AXIS2_MEP_URI_IN_ONLY) == 0)
         {
             return status;
         }
@@ -831,16 +775,14 @@
         {
             /* AXIS2_MEP_URI_IN_OUT case , we have a response this
              * time */
-            soap_ns_uri = axis2_msg_ctx_get_is_soap_11(msg_ctx, env) ?
-                AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI :
-                AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
-            response_envelope =
-                axis2_http_transport_utils_create_soap_msg(env, msg_ctx,
-                                                           soap_ns_uri);
-            if (response_envelope)
+            soap_ns_uri
+                = axis2_msg_ctx_get_is_soap_11(msg_ctx, env) ? AXIOM_SOAP11_SOAP_ENVELOPE_NAMESPACE_URI
+                    : AXIOM_SOAP12_SOAP_ENVELOPE_NAMESPACE_URI;
+            response_envelope = axis2_http_transport_utils_create_soap_msg(env, msg_ctx,
+                soap_ns_uri);
+            if(response_envelope)
             {
-                axis2_msg_ctx_set_response_soap_envelope(msg_ctx, env,
-                                                         response_envelope);
+                axis2_msg_ctx_set_response_soap_envelope(msg_ctx, env, response_envelope);
             }
         }
     }
@@ -859,15 +801,15 @@
 
 AXIS2_EXPORT int
 #ifndef AXIS2_STATIC_DEPLOY
- axis2_get_instance(
+axis2_get_instance(
 #else
-axis2_http_transport_sender_get_instance(
+    axis2_http_transport_sender_get_instance(
 #endif
     struct axis2_transport_sender **inst,
     const axutil_env_t * env)
 {
     *inst = axis2_http_transport_sender_create(env);
-    if (!(*inst))
+    if(!(*inst))
     {
         return AXIS2_FAILURE;
     }
@@ -877,18 +819,17 @@
 
 AXIS2_EXPORT int
 #ifndef AXIS2_STATIC_DEPLOY
- axis2_remove_instance(
+axis2_remove_instance(
 #else
-axis2_http_transport_sender_remove_instance(
+    axis2_http_transport_sender_remove_instance(
 #endif
     axis2_transport_sender_t * inst,
     const axutil_env_t * env)
 {
-    if (inst)
+    if(inst)
     {
         AXIS2_TRANSPORT_SENDER_FREE(inst, env);
     }
     return AXIS2_SUCCESS;
 }
 
-

Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/axis2_libcurl.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/axis2_libcurl.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/axis2_libcurl.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/axis2_libcurl.c Tue Aug 18 10:15:49 2009
@@ -50,14 +50,14 @@
     axis2_bool_t cookies;
 };
 
-static size_t 
+static size_t
 axis2_libcurl_write_memory_callback(
     void *ptr,
     size_t size,
     size_t nmemb,
     void *data);
 
-static size_t 
+static size_t
 axis2_libcurl_header_callback(
     void *ptr,
     size_t size,
@@ -81,7 +81,7 @@
     const axis2_char_t * str);
 
 static void
-axis2_libcurl_free_headers(    
+axis2_libcurl_free_headers(
     axis2_libcurl_t *curl,
     const axutil_env_t * env);
 
@@ -160,8 +160,8 @@
         if (!soap_body)
         {
             AXIS2_HANDLE_ERROR(env,
-                            AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL,
-                            AXIS2_FAILURE);
+                AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL,
+                AXIS2_FAILURE);
             return AXIS2_FAILURE;
         }
 
@@ -169,20 +169,20 @@
         if (!body_node)
         {
             AXIS2_HANDLE_ERROR(env,
-                               AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL,
-                               AXIS2_FAILURE);
+                AXIS2_ERROR_SOAP_ENVELOPE_OR_SOAP_BODY_NULL,
+                AXIS2_FAILURE);
 
             return AXIS2_FAILURE;
         }
         data_out = axiom_node_get_first_element(body_node, env);
 
         method = (axutil_property_t *) axis2_msg_ctx_get_property(msg_ctx, env,
-                                                                  AXIS2_HTTP_METHOD);
+            AXIS2_HTTP_METHOD);
 
         if (method)
         {
             method_value =
-                (axis2_char_t *) axutil_property_get_value(method, env);
+            (axis2_char_t *) axutil_property_get_value(method, env);
         }
 
         /* The default is POST */
@@ -213,22 +213,21 @@
     if (conf)
     {
         trans_desc = axis2_conf_get_transport_out (conf,
-                                                   env, AXIS2_TRANSPORT_ENUM_HTTP);
+            env, AXIS2_TRANSPORT_ENUM_HTTP);
     }
 
     if (trans_desc)
     {
         write_xml_declaration_param =
-            axutil_param_container_get_param
-            (axis2_transport_out_desc_param_container (trans_desc, env), env,
-             AXIS2_XML_DECLARATION);
+        axutil_param_container_get_param
+        (axis2_transport_out_desc_param_container (trans_desc, env), env,
+            AXIS2_XML_DECLARATION);
     }
 
-
     if (write_xml_declaration_param)
     {
-        transport_attrs = 
-            axutil_param_get_attributes (write_xml_declaration_param, env);
+        transport_attrs =
+        axutil_param_get_attributes (write_xml_declaration_param, env);
         if (transport_attrs)
         {
             axutil_generic_obj_t *obj = NULL;
@@ -236,21 +235,21 @@
             axis2_char_t *write_xml_declaration_attr_value = NULL;
 
             obj = axutil_hash_get (transport_attrs, AXIS2_ADD_XML_DECLARATION,
-                           AXIS2_HASH_KEY_STRING);
+                AXIS2_HASH_KEY_STRING);
             if (obj)
             {
-                write_xml_declaration_attr = (axiom_attribute_t *) 
-                    axutil_generic_obj_get_value (obj,
-                                                  env);
+                write_xml_declaration_attr = (axiom_attribute_t *)
+                axutil_generic_obj_get_value (obj,
+                    env);
             }
             if (write_xml_declaration_attr)
             {
-                write_xml_declaration_attr_value = 
-                    axiom_attribute_get_value (write_xml_declaration_attr, env);
+                write_xml_declaration_attr_value =
+                axiom_attribute_get_value (write_xml_declaration_attr, env);
             }
-            if (write_xml_declaration_attr_value && 
-                0 == axutil_strcasecmp (write_xml_declaration_attr_value, 
-                                        AXIS2_VALUE_TRUE))
+            if (write_xml_declaration_attr_value &&
+                0 == axutil_strcasecmp (write_xml_declaration_attr_value,
+                    AXIS2_VALUE_TRUE))
             {
                 write_xml_declaration = AXIS2_TRUE;
             }
@@ -289,9 +288,9 @@
                 {
                     axis2_char_t *tmp_soap_action = NULL;
                     tmp_soap_action =
-                        AXIS2_MALLOC(env->allocator,
-                                     (axutil_strlen(soap_action) +
-                                      5) * sizeof(axis2_char_t));
+                    AXIS2_MALLOC(env->allocator,
+                        (axutil_strlen(soap_action) +
+                            5) * sizeof(axis2_char_t));
                     sprintf(tmp_soap_action, "\"%s\"", soap_action);
                     tmp_strcat = axutil_stracat(env, soap_action_header,tmp_soap_action);
                     headers = curl_slist_append(headers, tmp_strcat);
@@ -309,11 +308,11 @@
             if (doing_mtom)
             {
                 /*axiom_output_flush(om_output, env, &output_stream,
-                                   &output_stream_size);*/
+                 &output_stream_size);*/
                 axiom_output_flush(om_output, env);
                 content_type =
-                    (axis2_char_t *) axiom_output_get_content_type(om_output,
-                                                                   env);
+                (axis2_char_t *) axiom_output_get_content_type(om_output,
+                    env);
                 if (AXIS2_TRUE != axis2_msg_ctx_get_is_soap_11(msg_ctx, env))
                 {
                     if (axutil_strcmp(soap_action, ""))
@@ -321,17 +320,17 @@
                         /* handle SOAP action for SOAP 1.2 case */
                         axis2_char_t *temp_content_type = NULL;
                         temp_content_type = axutil_stracat (env,
-                                                            content_type,
-                                                            AXIS2_CONTENT_TYPE_ACTION);
+                            content_type,
+                            AXIS2_CONTENT_TYPE_ACTION);
                         content_type = temp_content_type;
                         temp_content_type = axutil_stracat (env,
-                                                            content_type,
-                                                            soap_action);
+                            content_type,
+                            soap_action);
                         AXIS2_FREE (env->allocator, content_type);
                         content_type = temp_content_type;
                         temp_content_type =
-                            axutil_stracat (env, content_type, 
-                                            AXIS2_ESC_DOUBLE_QUOTE_STR);
+                        axutil_stracat (env, content_type,
+                            AXIS2_ESC_DOUBLE_QUOTE_STR);
                         AXIS2_FREE (env->allocator, content_type);
                         content_type = temp_content_type;
                     }
@@ -341,11 +340,11 @@
             {
                 axis2_char_t *temp_content_type = NULL;
                 content_type =
-                    (axis2_char_t *) AXIS2_HTTP_HEADER_ACCEPT_TEXT_XML;
-                content_type = axutil_stracat(env, content_type, 
-                                              AXIS2_CONTENT_TYPE_CHARSET);
+                (axis2_char_t *) AXIS2_HTTP_HEADER_ACCEPT_TEXT_XML;
+                content_type = axutil_stracat(env, content_type,
+                    AXIS2_CONTENT_TYPE_CHARSET);
                 temp_content_type =
-                    axutil_stracat(env, content_type, char_set_enc);
+                axutil_stracat(env, content_type, char_set_enc);
                 AXIS2_FREE(env->allocator, content_type);
                 content_type = temp_content_type;
             }
@@ -353,27 +352,27 @@
             {
                 axis2_char_t *temp_content_type = NULL;
                 content_type =
-                    (axis2_char_t *) AXIS2_HTTP_HEADER_ACCEPT_APPL_SOAP;
-                content_type = axutil_stracat(env, content_type, 
-                                              AXIS2_CONTENT_TYPE_CHARSET);
+                (axis2_char_t *) AXIS2_HTTP_HEADER_ACCEPT_APPL_SOAP;
+                content_type = axutil_stracat(env, content_type,
+                    AXIS2_CONTENT_TYPE_CHARSET);
                 temp_content_type =
-                    axutil_stracat(env, content_type, char_set_enc);
+                axutil_stracat(env, content_type, char_set_enc);
                 AXIS2_FREE(env->allocator, content_type);
                 content_type = temp_content_type;
                 if (axutil_strcmp(soap_action, ""))
                 {
                     temp_content_type =
-                        axutil_stracat(env, content_type, 
-                                       AXIS2_CONTENT_TYPE_ACTION);
+                    axutil_stracat(env, content_type,
+                        AXIS2_CONTENT_TYPE_ACTION);
                     AXIS2_FREE(env->allocator, content_type);
                     content_type = temp_content_type;
                     temp_content_type =
-                        axutil_stracat(env, content_type, soap_action);
+                    axutil_stracat(env, content_type, soap_action);
                     AXIS2_FREE(env->allocator, content_type);
                     content_type = temp_content_type;
                 }
-                temp_content_type = axutil_stracat(env, content_type, 
-                                                   AXIS2_SEMI_COLON_STR);
+                temp_content_type = axutil_stracat(env, content_type,
+                    AXIS2_SEMI_COLON_STR);
                 AXIS2_FREE(env->allocator, content_type);
                 content_type = temp_content_type;
             }
@@ -381,7 +380,7 @@
         else if (is_soap)
         {
             AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "Attempt to send SOAP"
-                             "message using HTTP PUT failed");
+                "message using HTTP PUT failed");
             return AXIS2_FAILURE;
         }
         else
@@ -392,22 +391,22 @@
 
             axiom_node_serialize(data_out, env, om_output);
             content_type_property =
-                (axutil_property_t *) 
-                axis2_msg_ctx_get_property(msg_ctx, env,
-                                           AXIS2_USER_DEFINED_HTTP_HEADER_CONTENT_TYPE);
+            (axutil_property_t *)
+            axis2_msg_ctx_get_property(msg_ctx, env,
+                AXIS2_USER_DEFINED_HTTP_HEADER_CONTENT_TYPE);
 
             if (content_type_property)
             {
                 content_type_hash =
-                    (axutil_hash_t *)
-                    axutil_property_get_value(content_type_property, env);
+                (axutil_hash_t *)
+                axutil_property_get_value(content_type_property, env);
 
                 if (content_type_hash)
                 {
                     content_type_value =
-                        (char *) axutil_hash_get(content_type_hash,
-                                                 AXIS2_HTTP_HEADER_CONTENT_TYPE,
-                                                 AXIS2_HASH_KEY_STRING);
+                    (char *) axutil_hash_get(content_type_hash,
+                        AXIS2_HTTP_HEADER_CONTENT_TYPE,
+                        AXIS2_HASH_KEY_STRING);
                 }
             }
 
@@ -428,7 +427,7 @@
             buffer_size = axiom_xml_writer_get_xml_size(xml_writer, env);
         }
         else
-            buffer_size = output_stream_size;
+        buffer_size = output_stream_size;
         {
             char tmp_buf[10];
             sprintf(tmp_buf, "%d", buffer_size);
@@ -451,11 +450,10 @@
         else
         {
             curl_easy_setopt(handler, CURLOPT_POSTFIELDSIZE,
-                             output_stream_size);
+                output_stream_size);
             curl_easy_setopt(handler, CURLOPT_POSTFIELDS, output_stream);
         }
 
-
         if (send_via_put)
         {
             curl_easy_setopt(handler, CURLOPT_CUSTOMREQUEST, AXIS2_HTTP_PUT);
@@ -467,10 +465,10 @@
         axis2_char_t *request_param;
         axis2_char_t *url_encode;
         request_param =
-            (axis2_char_t *) axis2_http_sender_get_param_string(NULL, env,
-                                                                msg_ctx);
-        url_encode = axutil_strcat(env, str_url, AXIS2_Q_MARK_STR, 
-                                   request_param, NULL);
+        (axis2_char_t *) axis2_http_sender_get_param_string(NULL, env,
+            msg_ctx);
+        url_encode = axutil_strcat(env, str_url, AXIS2_Q_MARK_STR,
+            request_param, NULL);
         if (send_via_get)
         {
             curl_easy_setopt(handler, CURLOPT_HTTPGET, 1);
@@ -489,13 +487,13 @@
     {
         axis2_bool_t manage_session;
         manage_session = axis2_msg_ctx_get_manage_session(msg_ctx, env);
-        if (manage_session == AXIS2_TRUE) 
+        if (manage_session == AXIS2_TRUE)
         {
             if (data->cookies == AXIS2_FALSE)
             {
                 /* Ensure cookies enabled to manage session */
                 /* Pass empty cookie string to enable cookies */
-                curl_easy_setopt(handler, CURLOPT_COOKIEFILE, " ");	
+                curl_easy_setopt(handler, CURLOPT_COOKIEFILE, " ");
                 data->cookies = AXIS2_TRUE;
             }
         }
@@ -503,15 +501,15 @@
         {
             /* Pass special string ALL to reset cookies if any have been enabled. */
             /* If cookies have ever been enabled, we reset every time as long as 
-               manage_session is false, as there is no clear curl option to 
-               turn off the cookie engine once enabled. */
-            curl_easy_setopt(handler, CURLOPT_COOKIELIST, AXIS2_ALL);	
+             manage_session is false, as there is no clear curl option to
+             turn off the cookie engine once enabled. */
+            curl_easy_setopt(handler, CURLOPT_COOKIELIST, AXIS2_ALL);
         }
     }
 
     curl_easy_setopt(handler, CURLOPT_HTTPHEADER, headers);
     curl_easy_setopt(handler, CURLOPT_WRITEFUNCTION,
-                     axis2_libcurl_write_memory_callback);
+        axis2_libcurl_write_memory_callback);
     curl_easy_setopt(handler, CURLOPT_WRITEDATA, data);
 
     curl_easy_setopt (handler, CURLOPT_HEADERFUNCTION, axis2_libcurl_header_callback);
@@ -528,11 +526,11 @@
         data->size = 0;
     }
 
-    if (curl_easy_perform(handler)) 
+    if (curl_easy_perform(handler))
     {
         AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "%s", &data->errorbuffer);
         AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_HTTP_CLIENT_TRANSPORT_ERROR,
-                           AXIS2_FAILURE);
+            AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
 
@@ -540,10 +538,10 @@
     trans_in_property = axutil_property_create(env);
     axutil_property_set_scope(trans_in_property, env, AXIS2_SCOPE_REQUEST);
     axutil_property_set_free_func(trans_in_property, env,
-                                  libcurl_stream_free);
+        libcurl_stream_free);
     axutil_property_set_value(trans_in_property, env, in_stream);
     axis2_msg_ctx_set_property(msg_ctx, env, AXIS2_TRANSPORT_IN,
-                               trans_in_property);
+        trans_in_property);
 
     if (axutil_array_list_size(data->alist, env) > 0)
     {
@@ -561,24 +559,24 @@
 
     axis2_msg_ctx_set_status_code (msg_ctx, env, status_code);
     AXIS2_FREE(data->env->allocator, content_type);
-    content_type = axis2_libcurl_get_content_type(data, env); 
+    content_type = axis2_libcurl_get_content_type(data, env);
 
     if (content_type)
-    {    
+    {
         if (strstr (content_type, AXIS2_HTTP_HEADER_ACCEPT_MULTIPART_RELATED)
             && strstr (content_type, AXIS2_HTTP_HEADER_ACCEPT_XOP_XML))
         {
             axis2_ctx_t *axis_ctx =
-                axis2_op_ctx_get_base (axis2_msg_ctx_get_op_ctx (msg_ctx, env),
-                                       env);
+            axis2_op_ctx_get_base (axis2_msg_ctx_get_op_ctx (msg_ctx, env),
+                env);
             property = axutil_property_create (env);
             axutil_property_set_scope (property, env, AXIS2_SCOPE_REQUEST);
             axutil_property_set_value (property,
-                                       env, axutil_strdup (env, content_type));
+                env, axutil_strdup (env, content_type));
             axis2_ctx_set_property (axis_ctx,
-                                    env, MTOM_RECIVED_CONTENT_TYPE, property);
+                env, MTOM_RECIVED_CONTENT_TYPE, property);
         }
-    } 
+    }
 
     content_length = axis2_libcurl_get_content_length(data, env);
     if (content_length >= 0)
@@ -589,14 +587,14 @@
         axutil_property_set_scope (property, env, AXIS2_SCOPE_REQUEST);
         axutil_property_set_value (property, env, response_length);
         axis2_msg_ctx_set_property (msg_ctx, env,
-                                    AXIS2_HTTP_HEADER_CONTENT_LENGTH, property);
+            AXIS2_HTTP_HEADER_CONTENT_LENGTH, property);
     }
 
     curl_slist_free_all (headers);
     /* release the read http headers. */
     /* (commenting out the call below is a clever way to force a premature EOF 
-       condition in subsequent messages, as they will be read using the content-length
-       of the first message.) */
+     condition in subsequent messages, as they will be read using the content-length
+     of the first message.) */
     axis2_libcurl_free_headers(data, env);
     AXIS2_FREE(data->env->allocator, content_type);
     axis2_http_status_line_free( status_line, env);
@@ -614,8 +612,8 @@
     size_t realsize = size * nmemb;
     axis2_libcurl_t *curl = (axis2_libcurl_t *) data;
     axis2_char_t *buffer =
-        (axis2_char_t *) AXIS2_MALLOC(curl->env->allocator,
-                                      curl->size + realsize + 1);
+    (axis2_char_t *) AXIS2_MALLOC(curl->env->allocator,
+        curl->size + realsize + 1);
     if (buffer)
     {
         if (curl->size)
@@ -660,30 +658,29 @@
     axis2_libcurl_t *curl = NULL;
     CURLcode code;
 
-
     if (!ref)
     {
         /* curl_global_init is not thread-safe so it would be better
-           to do this, as well as the test and increment of ref, under
-           mutex if one is available, or as part of an
-           axis2_initialize() if a global initialize is created.
-           Otherwise the client application should perform the the
-           curl_global_init itself in a thread-safe fashion. 
-        */
+         to do this, as well as the test and increment of ref, under
+         mutex if one is available, or as part of an
+         axis2_initialize() if a global initialize is created.
+         Otherwise the client application should perform the the
+         curl_global_init itself in a thread-safe fashion.
+         */
         code = curl_global_init(CURL_GLOBAL_ALL);
-        if (code)	
+        if (code)
         {
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, 
-                            "libcurl curl_global_init failed, error: %d", code); 
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                "libcurl curl_global_init failed, error: %d", code);
             return NULL;
         }
         ref++;
     }
 
     curl =
-        (axis2_libcurl_t *) AXIS2_MALLOC(env->allocator,
-                                         sizeof(axis2_libcurl_t));
-    if (curl) 
+    (axis2_libcurl_t *) AXIS2_MALLOC(env->allocator,
+        sizeof(axis2_libcurl_t));
+    if (curl)
     {
         curl->memory = 0;
         curl->size = 0;
@@ -712,7 +709,7 @@
 
     if (curl->handler)
     {
-        curl_easy_cleanup (curl->handler); 
+        curl_easy_cleanup (curl->handler);
     }
     if (curl->alist)
     {
@@ -720,16 +717,16 @@
         axutil_array_list_free(curl->alist, env);
         curl->alist = NULL;
     }
-    if (curl->memory) 
+    if (curl->memory)
     {
         AXIS2_FREE(env->allocator, curl->memory);
     }
-    
+
     AXIS2_FREE(env->allocator, curl);
 }
 
 static void
-axis2_libcurl_free_headers(    
+axis2_libcurl_free_headers(
     axis2_libcurl_t *curl,
     const axutil_env_t * env)
 {
@@ -744,7 +741,7 @@
         }
     }
 }
- 
+
 static axis2_http_header_t *
 axis2_libcurl_get_first_header(
     axis2_libcurl_t *curl,
@@ -757,7 +754,7 @@
     int i = 0;
     int count = 0;
     axutil_array_list_t *header_group = NULL;
- 
+
     AXIS2_PARAM_CHECK(env->error, curl, NULL);
     AXIS2_PARAM_CHECK(env->error, str, NULL);
 
@@ -777,7 +774,7 @@
     for (i = 0; i < count; i++)
     {
         tmp_header_str = (axis2_char_t *) axutil_array_list_get(header_group,
-                                                                   env, i);
+            env, i);
         if(!tmp_header_str)
         {
             continue;
@@ -811,7 +808,7 @@
     int rtn_value = -1;
 
     tmp_header = axis2_libcurl_get_first_header
-        (curl, env, AXIS2_HTTP_HEADER_CONTENT_LENGTH);
+    (curl, env, AXIS2_HTTP_HEADER_CONTENT_LENGTH);
     if (tmp_header)
     {
         rtn_value = AXIS2_ATOI(axis2_http_header_get_value(tmp_header, env));
@@ -820,17 +817,16 @@
     return rtn_value;
 }
 
-
 static axis2_char_t *
 axis2_libcurl_get_content_type(
     axis2_libcurl_t *curl,
     const axutil_env_t * env)
 {
     axis2_http_header_t *tmp_header;
-    axis2_char_t *rtn_value	= NULL;
+    axis2_char_t *rtn_value = NULL;
 
     tmp_header = axis2_libcurl_get_first_header
-        (curl, env, AXIS2_HTTP_HEADER_CONTENT_TYPE);
+    (curl, env, AXIS2_HTTP_HEADER_CONTENT_TYPE);
     if (tmp_header)
     {
         rtn_value = axutil_strdup (env, axis2_http_header_get_value(tmp_header, env) );
@@ -846,5 +842,3 @@
 
 #endif                          /* AXIS2_LIBCURL_ENABLED */
 
-
-

Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/libcurl_stream.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/libcurl_stream.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/libcurl_stream.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/libcurl_stream.c Tue Aug 18 10:15:49 2009
@@ -73,8 +73,8 @@
     AXIS2_PARAM_CHECK(env->error, buffer, NULL);
 
     stream_impl =
-        (libcurl_stream_impl_t *) AXIS2_MALLOC(env->allocator,
-                                               sizeof(libcurl_stream_impl_t));
+    (libcurl_stream_impl_t *) AXIS2_MALLOC(env->allocator,
+        sizeof(libcurl_stream_impl_t));
 
     if (!stream_impl)
     {
@@ -129,7 +129,7 @@
             /* We are sure that the difference lies within the int range */
             {
                 memcpy(buffer, &stream_impl->buffer[stream_impl->read_len],
-                       count);
+                    count);
                 read = (int)count;
                 /* We are sure that the difference lies within the int range */
                 stream_impl->read_len += read;
@@ -137,25 +137,25 @@
             else
             {
                 memcpy(buffer, &stream_impl->buffer[stream_impl->read_len],
-                       unread);
+                    unread);
                 read = unread;
                 stream_impl->read_len += read;
             }
         }
         else
-            read = 0;
+        read = 0;
     }
     else
     {
         if (buffer && (stream_impl->size > stream_impl->read_len))
         {
             memcpy(buffer, &stream_impl->buffer[stream_impl->read_len],
-                   stream_impl->size - stream_impl->read_len);
+                stream_impl->size - stream_impl->read_len);
             read = stream_impl->size - stream_impl->read_len;
             stream_impl->read_len += read;
         }
         else
-            read = 0;
+        read = 0;
     }
     return read;
 }

Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/ssl/ssl_stream.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/ssl/ssl_stream.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/ssl/ssl_stream.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/ssl/ssl_stream.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -17,7 +16,6 @@
  */
 #ifdef AXIS2_SSL_ENABLED
 
-
 #include <string.h>
 #include <stdlib.h>
 #include "ssl_stream.h"
@@ -80,8 +78,8 @@
     ssl_stream_impl_t *stream_impl = NULL;
 
     stream_impl =
-        (ssl_stream_impl_t *) AXIS2_MALLOC(env->allocator,
-                                           sizeof(ssl_stream_impl_t));
+    (ssl_stream_impl_t *) AXIS2_MALLOC(env->allocator,
+        sizeof(ssl_stream_impl_t));
 
     if (!stream_impl)
     {
@@ -94,7 +92,7 @@
     stream_impl->ssl = NULL;
 
     stream_impl->ctx = axis2_ssl_utils_initialize_ctx(env, server_cert,
-                                                      key_file, ssl_pp);
+        key_file, ssl_pp);
     if (!stream_impl->ctx)
     {
         axis2_ssl_stream_free((axutil_stream_t *) stream_impl, env);
@@ -102,7 +100,7 @@
         return NULL;
     }
     stream_impl->ssl = axis2_ssl_utils_initialize_ssl(env, stream_impl->ctx,
-                                                      stream_impl->socket);
+        stream_impl->socket);
     if (!stream_impl->ssl)
     {
         AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_SSL_ENGINE, AXIS2_FAILURE);
@@ -112,7 +110,7 @@
 
     axutil_stream_set_read(&(stream_impl->stream), env, axis2_ssl_stream_read);
     axutil_stream_set_write(&(stream_impl->stream), env,
-                            axis2_ssl_stream_write);
+        axis2_ssl_stream_write);
     axutil_stream_set_skip(&(stream_impl->stream), env, axis2_ssl_stream_skip);
 
     return &(stream_impl->stream);
@@ -143,26 +141,25 @@
     int read = -1;
     int len = -1;
 
-
     stream_impl = AXIS2_INTF_TO_IMPL(stream);
-    
-    SSL_set_mode(stream_impl->ssl, SSL_MODE_AUTO_RETRY); 
+
+    SSL_set_mode(stream_impl->ssl, SSL_MODE_AUTO_RETRY);
 
     read = SSL_read(stream_impl->ssl, buffer, (int)count);
     /* We are sure that the difference lies within the int range */
     switch (SSL_get_error(stream_impl->ssl, read))
     {
-    case SSL_ERROR_NONE:
+        case SSL_ERROR_NONE:
         len = read;
         break;
-    case SSL_ERROR_ZERO_RETURN:
+        case SSL_ERROR_ZERO_RETURN:
         len = -1;
         break;
-    case SSL_ERROR_SYSCALL:
+        case SSL_ERROR_SYSCALL:
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "SSL Error: Premature close");
         len = -1;
         break;
-    default:
+        default:
         len = -1;
         break;
     }
@@ -186,12 +183,12 @@
 
     switch (SSL_get_error(stream_impl->ssl, write))
     {
-    case SSL_ERROR_NONE:
+        case SSL_ERROR_NONE:
         if ((int)count != write)
-            /* We are sure that the difference lies within the int range */
-            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Incomplete SSL write!");
+        /* We are sure that the difference lies within the int range */
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Incomplete SSL write!");
         break;
-    default:
+        default:
         return -1;
     }
     return write;
@@ -240,9 +237,3 @@
 
 #endif
 
-
-
-
-
-
-

Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/ssl/ssl_utils.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/ssl/ssl_utils.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/ssl/ssl_utils.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/ssl/ssl_utils.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -69,12 +68,12 @@
     /* Load our keys and certificates
      * If we need client certificates it has to be done here
      */
-    if (key_file)               /*can we check if the server needs client auth? */
+    if (key_file) /*can we check if the server needs client auth? */
     {
         if (!ssl_pp)
         {
-            AXIS2_LOG_INFO(env->log, 
-                           "[ssl client] No passphrase specified for \
+            AXIS2_LOG_INFO(env->log,
+                "[ssl client] No passphrase specified for \
 key file %s and server cert %s", key_file, server_cert);
         }
 
@@ -84,7 +83,7 @@
         if (!(SSL_CTX_use_certificate_chain_file(ctx, key_file)))
         {
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
-                            "[ssl client] Loading client certificate failed \
+                "[ssl client] Loading client certificate failed \
 , key file %s", key_file);
             SSL_CTX_free(ctx);
             return NULL;
@@ -93,7 +92,7 @@
         if (!(SSL_CTX_use_PrivateKey_file(ctx, key_file, SSL_FILETYPE_PEM)))
         {
             AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
-                            "[ssl client] Loading client key failed, key file \
+                "[ssl client] Loading client key failed, key file \
 %s", key_file);
             SSL_CTX_free(ctx);
             return NULL;
@@ -101,16 +100,16 @@
     }
     else
     {
-        AXIS2_LOG_INFO(env->log, 
-                       "[ssl client] Client certificate chain file"
-                       "not specified");
+        AXIS2_LOG_INFO(env->log,
+            "[ssl client] Client certificate chain file"
+            "not specified");
     }
 
     /* Load the CAs we trust */
     if (!(SSL_CTX_load_verify_locations(ctx, ca_file, 0)))
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
-                        "[ssl client] Loading CA certificate failed, \
+            "[ssl client] Loading CA certificate failed, \
 ca_file is %s", ca_file);
         SSL_CTX_free(ctx);
         return NULL;
@@ -133,17 +132,17 @@
     ssl = SSL_new(ctx);
     if (!ssl)
     {
-        AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
-                         "[ssl]unable to create new ssl context");
+        AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
+            "[ssl]unable to create new ssl context");
         return NULL;
     }
 
     sbio = BIO_new_socket((int)socket, BIO_NOCLOSE);
     if (!sbio)
     {
-        AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, 
-                         "[ssl]unable to create BIO new socket for socket %d", 
-                         (int)socket);
+        AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
+            "[ssl]unable to create BIO new socket for socket %d",
+            (int)socket);
         return NULL;
     }
 
@@ -173,22 +172,22 @@
         if (peer_name && cert_store)
         {
             client_object = X509_OBJECT_retrieve_by_subject(cert_store->objs,
-                                                            X509_LU_X509,
-                                                            peer_name);
+                X509_LU_X509,
+                peer_name);
         }
         if (client_object)
         {
             client_cert = (client_object->data).x509;
-            if (client_cert && 
-		(M_ASN1_BIT_STRING_cmp(client_cert->signature, 
-                                       peer_cert->signature) == 0))
+            if (client_cert &&
+                (M_ASN1_BIT_STRING_cmp(client_cert->signature,
+                        peer_cert->signature) == 0))
             {
                 if (peer_cert)
                 {
                     X509_free(peer_cert);
                 }
                 AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
-                        "[ssl client] SSL certificate verified against peer");
+                    "[ssl client] SSL certificate verified against peer");
                 return ssl;
             }
         }
@@ -198,8 +197,8 @@
         }
         ERR_error_string(SSL_get_verify_result(ssl), sslerror);
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
-                        "[ssl client] SSL certificate verification failed (%s)",
-                        sslerror);
+            "[ssl client] SSL certificate verification failed (%s)",
+            sslerror);
         return NULL;
     }
 

Modified: webservices/axis2/trunk/c/src/core/transport/http/server/CGI/axis2_cgi_main.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/CGI/axis2_cgi_main.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/CGI/axis2_cgi_main.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/CGI/axis2_cgi_main.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -39,14 +38,17 @@
 
 /***************************** Function headers *******************************/
 
-void axis2_cgi_system_exit(
+void
+axis2_cgi_system_exit(
     axutil_env_t * env,
     int status);
-    
-void axis2_cgi_set_request_vars(
+
+void
+axis2_cgi_set_request_vars(
     axis2_cgi_request_t *cgi_request);
-    
-axis2_status_t axis2_cgi_write_response(
+
+axis2_status_t
+axis2_cgi_write_response(
     const void *buffer,
     unsigned int length);
 
@@ -56,10 +58,10 @@
 main(
     int argc,
     char *argv[])
-{    
+{
     axutil_allocator_t *allocator = NULL;
     axutil_env_t *env = NULL;
-    const axis2_char_t *repo_path;	
+    const axis2_char_t *repo_path;
     axis2_conf_ctx_t *conf_ctx;
     axis2_cgi_request_t *cgi_request = NULL;
     int content_length = 0;
@@ -70,82 +72,80 @@
     axis2_transport_out_desc_t *out_desc = NULL;
     /* axis2_msg_ctx_t *msg_ctx = NULL; */
     /* axis2_bool_t processed = AXIS2_FALSE; */
-    axis2_http_transport_in_t request;	
+    axis2_http_transport_in_t request;
     axis2_http_transport_out_t response;
     /*axis2_http_header_t* http_header = NULL; */
     /*axutil_hash_t *headers = NULL; */
     /* axis2_char_t *axis2_cgi_url_prefix = NULL; */
-    
-	if (!(repo_path = AXIS2_GETENV("AXIS2C_HOME")))
-	{
-		fprintf(stderr, "Error: AXIS2C_HOME environment variable not set!");
-		axis2_cgi_system_exit(env, -1);
-	}
+
+    if(!(repo_path = AXIS2_GETENV("AXIS2C_HOME")))
+    {
+        fprintf(stderr, "Error: AXIS2C_HOME environment variable not set!");
+        axis2_cgi_system_exit(env, -1);
+    }
 
     allocator = axutil_allocator_init(NULL);
     env = axutil_env_create(allocator);
-    
-    if (axutil_file_handler_access (repo_path, AXIS2_R_OK) != AXIS2_SUCCESS)
+
+    if(axutil_file_handler_access(repo_path, AXIS2_R_OK) != AXIS2_SUCCESS)
     {
-		fprintf(stderr, "Error reading repository: %s\nPlease check AXIS2C_HOME var", repo_path);
-		axis2_cgi_system_exit(env, -1);
+        fprintf(stderr, "Error reading repository: %s\nPlease check AXIS2C_HOME var", repo_path);
+        axis2_cgi_system_exit(env, -1);
     }
-    
+
     /* Set configuration */
 
-	conf_ctx = axis2_build_conf_ctx(env, repo_path);
-	if (!conf_ctx)
-	{
-		fprintf(stderr, "Error: Configuration not builded propertly\n");
-	    axis2_cgi_system_exit(env, -1);
-	}
-		
-	axis2_http_transport_utils_transport_out_init(&response, env);
+    conf_ctx = axis2_build_conf_ctx(env, repo_path);
+    if(!conf_ctx)
+    {
+        fprintf(stderr, "Error: Configuration not builded propertly\n");
+        axis2_cgi_system_exit(env, -1);
+    }
+
+    axis2_http_transport_utils_transport_out_init(&response, env);
     axis2_http_transport_utils_transport_in_init(&request, env);
 
     /* Get input info */
-    
+
     cgi_request = AXIS2_MALLOC(allocator, sizeof(axis2_cgi_request_t));
     axis2_cgi_set_request_vars(cgi_request);
-    
-    request_url = (axis2_char_t *) AXIS2_MALLOC(allocator, 
-           (7 +                 /* "http:" */
-		    strlen(cgi_request->server_name) + 
-			((strlen(cgi_request->server_port))?1:0) + /* ":"*/
-		    strlen(cgi_request->server_port) +
-			strlen(cgi_request->script_name) + 
-            strlen(cgi_request->path_info) +
-            ((strlen(cgi_request->path_info))?1:0) + /* "?" */
-            strlen(cgi_request->query_string) ) * sizeof(axis2_char_t));
-            
+
+    request_url = (axis2_char_t *)AXIS2_MALLOC(allocator, (7 + /* "http:" */
+    strlen(cgi_request->server_name) + ((strlen(cgi_request->server_port)) ? 1 : 0) + /* ":"*/
+    strlen(cgi_request->server_port) + strlen(cgi_request->script_name) + strlen(
+        cgi_request->path_info) + ((strlen(cgi_request->path_info)) ? 1 : 0) + /* "?" */
+    strlen(cgi_request->query_string)) * sizeof(axis2_char_t));
+
     request_url[0] = '\0';
-	
-	strcat(request_url, "http://");
-	strcat(request_url, cgi_request->server_name);
-	if (strlen(cgi_request->server_port)) strcat(request_url, ":");
-	strcat(request_url, cgi_request->server_port);
-    strcat(request_url, cgi_request->script_name); 
+
+    strcat(request_url, "http://");
+    strcat(request_url, cgi_request->server_name);
+    if(strlen(cgi_request->server_port))
+        strcat(request_url, ":");
+    strcat(request_url, cgi_request->server_port);
+    strcat(request_url, cgi_request->script_name);
     strcat(request_url, cgi_request->path_info);
-    if (strlen(cgi_request->query_string)) strcat(request_url, "?");
+    if(strlen(cgi_request->query_string))
+        strcat(request_url, "?");
     strcat(request_url, cgi_request->query_string);
-    
-    if (cgi_request->content_length) content_length = axutil_atoi(cgi_request->content_length);
-    else content_length = 0;
-    
+
+    if(cgi_request->content_length)
+        content_length = axutil_atoi(cgi_request->content_length);
+    else
+        content_length = 0;
+
     /* Set streams */
 
     out_stream = axutil_stream_create_basic(env);
-        
-	/* Set message contexts */
-        
-    out_desc = axis2_conf_get_transport_out(axis2_conf_ctx_get_conf
-                                            (conf_ctx, env),
-                                            env, AXIS2_TRANSPORT_ENUM_HTTP);
-    in_desc = axis2_conf_get_transport_in(axis2_conf_ctx_get_conf
-                                            (conf_ctx, env),
-                                            env, AXIS2_TRANSPORT_ENUM_HTTP);     
 
-    request.msg_ctx = axis2_msg_ctx_create(env, conf_ctx, in_desc, out_desc);                                
+    /* Set message contexts */
+
+    out_desc = axis2_conf_get_transport_out(axis2_conf_ctx_get_conf(conf_ctx, env), env,
+        AXIS2_TRANSPORT_ENUM_HTTP);
+    in_desc = axis2_conf_get_transport_in(axis2_conf_ctx_get_conf(conf_ctx, env), env,
+        AXIS2_TRANSPORT_ENUM_HTTP);
+
+    request.msg_ctx = axis2_msg_ctx_create(env, conf_ctx, in_desc, out_desc);
 
     axis2_msg_ctx_set_server_side(request.msg_ctx, env, AXIS2_TRUE);
     axis2_msg_ctx_set_transport_out_stream(request.msg_ctx, env, out_stream);
@@ -163,78 +163,80 @@
     request.accept_header = AXIS2_GETENV("HTTP_ACCEPT");
     request.accept_language_header = AXIS2_GETENV("HTTP_ACCEPT_LANGUAGE");
     request.accept_charset_header = AXIS2_GETENV("HTTP_ACCEPT_CHARSET");
-    request.request_url_prefix = (AXIS2_GETENV("AXIS2C_URL_PREFIX"))?
-                                  AXIS2_GETENV("AXIS2C_URL_PREFIX"):
-                                  axis2_cgi_default_url_prefix;
-            
-    if (axutil_strcasecmp(cgi_request->request_method, "POST") == 0)
-	{
-		request.request_method = AXIS2_HTTP_METHOD_POST;
-	}
-	else if (axutil_strcasecmp(cgi_request->request_method, "GET") == 0)
-	{
-		request.request_method = AXIS2_HTTP_METHOD_GET;
-	}
-	else if (axutil_strcasecmp(cgi_request->request_method, "HEAD") == 0)
-	{
-		request.request_method = AXIS2_HTTP_METHOD_HEAD;
-	}
-	else if (axutil_strcasecmp(cgi_request->request_method, "PUT") == 0)
-	{
-		request.request_method = AXIS2_HTTP_METHOD_PUT;
-	}
-	else if (axutil_strcasecmp(cgi_request->request_method, "DELETE") == 0)
-	{
-		request.request_method = AXIS2_HTTP_METHOD_DELETE;
-	}
-	
-	request.out_transport_info = axis2_cgi_out_transport_info_create(env, cgi_request);
-        
+    request.request_url_prefix = (AXIS2_GETENV("AXIS2C_URL_PREFIX")) ? AXIS2_GETENV(
+        "AXIS2C_URL_PREFIX") : axis2_cgi_default_url_prefix;
+
+    if(axutil_strcasecmp(cgi_request->request_method, "POST") == 0)
+    {
+        request.request_method = AXIS2_HTTP_METHOD_POST;
+    }
+    else if(axutil_strcasecmp(cgi_request->request_method, "GET") == 0)
+    {
+        request.request_method = AXIS2_HTTP_METHOD_GET;
+    }
+    else if(axutil_strcasecmp(cgi_request->request_method, "HEAD") == 0)
+    {
+        request.request_method = AXIS2_HTTP_METHOD_HEAD;
+    }
+    else if(axutil_strcasecmp(cgi_request->request_method, "PUT") == 0)
+    {
+        request.request_method = AXIS2_HTTP_METHOD_PUT;
+    }
+    else if(axutil_strcasecmp(cgi_request->request_method, "DELETE") == 0)
+    {
+        request.request_method = AXIS2_HTTP_METHOD_DELETE;
+    }
+
+    request.out_transport_info = axis2_cgi_out_transport_info_create(env, cgi_request);
+
     /*Process request */
     fprintf(stderr, "ok\n");
     axis2_http_transport_utils_process_request(env, conf_ctx, &request, &response);
     fprintf(stderr, "ok\n");
     /*Send status */
-    
+
     fprintf(stdout, "Status: %d %s \r\n", response.http_status_code, response.http_status_code_name);
 
-    if (response.content_type)
+    if(response.content_type)
     {
         fprintf(stdout, "Content-type: %s \r\n", response.content_type);
     }
-    else if (strlen(axis2_cgi_out_transport_get_content(request.out_transport_info))
-               && axis2_cgi_out_transport_get_content(request.out_transport_info))
+    else if(strlen(axis2_cgi_out_transport_get_content(request.out_transport_info))
+        && axis2_cgi_out_transport_get_content(request.out_transport_info))
     {
-        fprintf(stdout, "Content-type: %s \r\n", axis2_cgi_out_transport_get_content(request.out_transport_info));
+        fprintf(stdout, "Content-type: %s \r\n", axis2_cgi_out_transport_get_content(
+            request.out_transport_info));
     }
-    
+
     fprintf(stdout, "\r\n"); /* End of headers for server */
-    
+
     /* Write data body */
-    if (!axis2_cgi_write_response(response.response_data, response.response_data_length))
+    if(!axis2_cgi_write_response(response.response_data, response.response_data_length))
     {
         fprintf(stderr, "Error writing output data\n");
     }
-        
+
     axis2_http_transport_utils_transport_in_uninit(&request, env);
-	axis2_http_transport_utils_transport_out_uninit(&response, env);
-	
-	return 0;
+    axis2_http_transport_utils_transport_out_uninit(&response, env);
+
+    return 0;
 }
 
-axis2_status_t axis2_cgi_write_response(
+axis2_status_t
+axis2_cgi_write_response(
     const void *buffer,
     unsigned int length)
 {
-    if (buffer && length)
+    if(buffer && length)
     {
         unsigned int completed = 0;
         unsigned int written = 0;
-        
-        while (completed < length)
+
+        while(completed < length)
         {
             written = fwrite(buffer, sizeof(char), length - completed, stdout);
-            if (written < 0) return AXIS2_FALSE;
+            if(written < 0)
+                return AXIS2_FALSE;
             completed += written;
         }
     }
@@ -245,17 +247,21 @@
 axis2_cgi_set_request_vars(
     axis2_cgi_request_t *cgi_request)
 {
-    cgi_request->server_name = (AXIS2_GETENV("SERVER_NAME"))?AXIS2_GETENV("SERVER_NAME"):"";
-	cgi_request->script_name = (AXIS2_GETENV("SCRIPT_NAME"))?AXIS2_GETENV("SCRIPT_NAME"):"";
-	cgi_request->path_info = (AXIS2_GETENV("PATH_INFO"))?AXIS2_GETENV("PATH_INFO"):"";
-	cgi_request->server_port = (AXIS2_GETENV("SERVER_PORT"))?AXIS2_GETENV("SERVER_PORT"):"";
-	cgi_request->server_protocol = (AXIS2_GETENV("SERVER_PROTOCOL"))?AXIS2_GETENV("SERVER_PROTOCOL"):"";
-	cgi_request->content_length = (AXIS2_GETENV("CONTENT_LENGTH"))?AXIS2_GETENV("CONTENT_LENGTH"):"";
-	cgi_request->content_type = (AXIS2_GETENV("CONTENT_TYPE"))?AXIS2_GETENV("CONTENT_TYPE"):"";
-	cgi_request->request_method = (AXIS2_GETENV("REQUEST_METHOD"))?AXIS2_GETENV("REQUEST_METHOD"):"";
-	cgi_request->remote_addr = (AXIS2_GETENV("REMOTE_ADDR"))?AXIS2_GETENV("REMOTE_ADDR"):"";
-	cgi_request->soap_action = (AXIS2_GETENV("HTTP_SOAPACTION"))?AXIS2_GETENV("HTTP_SOAPACTION"):NULL;
-	cgi_request->query_string = (AXIS2_GETENV("QUERY_STRING"))?AXIS2_GETENV("QUERY_STRING"):"";
+    cgi_request->server_name = (AXIS2_GETENV("SERVER_NAME")) ? AXIS2_GETENV("SERVER_NAME") : "";
+    cgi_request->script_name = (AXIS2_GETENV("SCRIPT_NAME")) ? AXIS2_GETENV("SCRIPT_NAME") : "";
+    cgi_request->path_info = (AXIS2_GETENV("PATH_INFO")) ? AXIS2_GETENV("PATH_INFO") : "";
+    cgi_request->server_port = (AXIS2_GETENV("SERVER_PORT")) ? AXIS2_GETENV("SERVER_PORT") : "";
+    cgi_request->server_protocol = (AXIS2_GETENV("SERVER_PROTOCOL")) ? AXIS2_GETENV(
+        "SERVER_PROTOCOL") : "";
+    cgi_request->content_length = (AXIS2_GETENV("CONTENT_LENGTH")) ? AXIS2_GETENV("CONTENT_LENGTH")
+        : "";
+    cgi_request->content_type = (AXIS2_GETENV("CONTENT_TYPE")) ? AXIS2_GETENV("CONTENT_TYPE") : "";
+    cgi_request->request_method = (AXIS2_GETENV("REQUEST_METHOD")) ? AXIS2_GETENV("REQUEST_METHOD")
+        : "";
+    cgi_request->remote_addr = (AXIS2_GETENV("REMOTE_ADDR")) ? AXIS2_GETENV("REMOTE_ADDR") : "";
+    cgi_request->soap_action = (AXIS2_GETENV("HTTP_SOAPACTION")) ? AXIS2_GETENV("HTTP_SOAPACTION")
+        : NULL;
+    cgi_request->query_string = (AXIS2_GETENV("QUERY_STRING")) ? AXIS2_GETENV("QUERY_STRING") : "";
 }
 
 void
@@ -264,8 +270,8 @@
     int status)
 {
     axutil_allocator_t *allocator = NULL;
-	
-    if (env)
+
+    if(env)
     {
         allocator = env->allocator;
         axutil_env_free(env);

Modified: webservices/axis2/trunk/c/src/core/transport/http/server/CGI/axis2_cgi_out_transport_info.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/CGI/axis2_cgi_out_transport_info.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/CGI/axis2_cgi_out_transport_info.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/CGI/axis2_cgi_out_transport_info.c Tue Aug 18 10:15:49 2009
@@ -1,4 +1,3 @@
-
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -15,7 +14,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #include "axis2_cgi_out_transport_info.h"
 #include <axutil_string.h>
 #include <axis2_http_transport.h>
@@ -30,11 +29,11 @@
     axis2_http_out_transport_info_t out_transport_info;
     axis2_cgi_request_t *request;
     axis2_char_t *encoding;
-} axis2_cgi_out_transport_info_t;   
+} axis2_cgi_out_transport_info_t;
 
 #define AXIS2_INTF_TO_IMPL(out_transport_info) \
                 ((axis2_cgi_out_transport_info_t *)(out_transport_info))
-               
+
 void AXIS2_CALL
 axis2_cgi_out_transport_info_free(
     axis2_http_out_transport_info_t * info,
@@ -44,9 +43,9 @@
     AXIS2_ENV_CHECK(env, void);
 
     info_impl = AXIS2_INTF_TO_IMPL(info);
-    
+
     info_impl->request = NULL; /* doesn't belong here so no need to free it here */
-    if (info_impl->encoding)
+    if(info_impl->encoding)
     {
         AXIS2_FREE(env->allocator, info_impl->encoding);
         info_impl->encoding = NULL;
@@ -64,7 +63,7 @@
     axis2_http_out_transport_info_t *transport_info_l = NULL;
 
     AXIS2_ENV_CHECK(env, void);
-    transport_info_l = (axis2_http_out_transport_info_t *) transport_info;
+    transport_info_l = (axis2_http_out_transport_info_t *)transport_info;
     axis2_http_out_transport_info_free(transport_info_l, env);
     return;
 }
@@ -83,7 +82,7 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, content_type, AXIS2_FAILURE);
     info_impl = AXIS2_INTF_TO_IMPL(info);
-    if (info_impl->encoding)
+    if(info_impl->encoding)
     {
         temp1 = axutil_stracat(env, content_type, ";charset=");
         temp2 = axutil_stracat(env, temp1, info_impl->encoding);
@@ -103,19 +102,19 @@
     axis2_http_out_transport_info_t * info,
     const axutil_env_t * env,
     const axis2_char_t * encoding)
-{    
+{
     axis2_cgi_out_transport_info_t *info_impl = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, encoding, AXIS2_FAILURE);
 
     info_impl = AXIS2_INTF_TO_IMPL(info);
-    
-    if (info_impl->encoding)
+
+    if(info_impl->encoding)
     {
         AXIS2_FREE(env->allocator, info_impl->encoding);
     }
     info_impl->encoding = axutil_strdup(env, encoding);
-    
+
     return AXIS2_SUCCESS;
 }
 
@@ -129,10 +128,10 @@
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    info = (axis2_cgi_out_transport_info_t *) AXIS2_MALLOC
-        (env->allocator, sizeof(axis2_cgi_out_transport_info_t));
+    info = (axis2_cgi_out_transport_info_t *)AXIS2_MALLOC(env->allocator,
+        sizeof(axis2_cgi_out_transport_info_t));
 
-    if (!info)
+    if(!info)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -142,11 +141,10 @@
 
     out_transport_info = &(info->out_transport_info);
 
-    axis2_http_out_transport_info_set_char_encoding_func(out_transport_info,
-                                                         env,
-                                                         axis2_cgi_out_transport_info_set_char_encoding);
+    axis2_http_out_transport_info_set_char_encoding_func(out_transport_info, env,
+        axis2_cgi_out_transport_info_set_char_encoding);
     axis2_http_out_transport_info_set_content_type_func(out_transport_info, env,
-                                                        axis2_cgi_out_transport_info_set_content_type);
+        axis2_cgi_out_transport_info_set_content_type);
 
     return out_transport_info;
 }



Mime
View raw message