You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by sa...@apache.org on 2007/09/28 11:53:04 UTC

svn commit: r580276 [22/26] - in /webservices/axis2/trunk/c/src: core/addr/ core/clientapi/ core/context/ core/deployment/ core/description/ core/engine/ core/phaseresolver/ core/receivers/ core/transport/ core/transport/http/common/ core/transport/htt...

Modified: webservices/axis2/trunk/c/src/core/transport/http/server/apache2/apache2_worker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/apache2/apache2_worker.c?rev=580276&r1=580275&r2=580276&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/apache2/apache2_worker.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/apache2/apache2_worker.c Fri Sep 28 02:52:58 2007
@@ -1,19 +1,19 @@
  /*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+  * Licensed to the Apache Software Foundation (ASF) under one or more
+  * contributor license agreements.  See the NOTICE file distributed with
+  * this work for additional information regarding copyright ownership.
+  * The ASF licenses this file to You under the Apache License, Version 2.0
+  * (the "License"); you may not use this file except in compliance with
+  * the License.  You may obtain a copy of the License at
+  *
+  *      http://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing, software
+  * distributed under the License is distributed on an "AS IS" BASIS,
+  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  * See the License for the specific language governing permissions and
+  * limitations under the License.
+  */
 
 #include "axis2_apache2_worker.h"
 #include <axis2_http_transport.h>
@@ -32,7 +32,6 @@
 #include <http_protocol.h>
 #include <axiom_soap.h>
 
-
 #define READ_SIZE  2048
 
 struct axis2_apache2_worker
@@ -42,41 +41,41 @@
 
 AXIS2_EXTERN axis2_apache2_worker_t *AXIS2_CALL
 axis2_apache2_worker_create(
-    const axutil_env_t *env,
-    axis2_char_t *repo_path)
+    const axutil_env_t * env,
+    axis2_char_t * repo_path)
 {
     axis2_apache2_worker_t *apache2_worker = NULL;
     AXIS2_ENV_CHECK(env, NULL);
     apache2_worker = (axis2_apache2_worker_t *)
-            AXIS2_MALLOC(env->allocator, sizeof(axis2_apache2_worker_t));
+        AXIS2_MALLOC(env->allocator, sizeof(axis2_apache2_worker_t));
 
-    if (! apache2_worker)
+    if (!apache2_worker)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
     apache2_worker->conf_ctx = axis2_build_conf_ctx(env, repo_path);
 
-    if (! apache2_worker->conf_ctx)
+    if (!apache2_worker->conf_ctx)
     {
-        axis2_apache2_worker_free((axis2_apache2_worker_t *)apache2_worker,
-                env);
+        axis2_apache2_worker_free((axis2_apache2_worker_t *) apache2_worker,
+                                  env);
         return NULL;
     }
-    
+
     return apache2_worker;
 }
 
 AXIS2_EXTERN void AXIS2_CALL
 axis2_apache2_worker_free(
-    axis2_apache2_worker_t *apache2_worker,
-    const axutil_env_t *env)
+    axis2_apache2_worker_t * apache2_worker,
+    const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, void);
 
     if (apache2_worker->conf_ctx)
     {
-         axis2_conf_ctx_free(apache2_worker->conf_ctx, env);
+        axis2_conf_ctx_free(apache2_worker->conf_ctx, env);
         apache2_worker->conf_ctx = NULL;
     }
 
@@ -87,9 +86,9 @@
 
 AXIS2_EXTERN int AXIS2_CALL
 axis2_apache2_worker_process_request(
-    axis2_apache2_worker_t *apache2_worker,
-    const axutil_env_t *env,
-    request_rec *request)
+    axis2_apache2_worker_t * apache2_worker,
+    const axutil_env_t * env,
+    request_rec * request)
 {
     axis2_conf_ctx_t *conf_ctx = NULL;
     axis2_msg_ctx_t *msg_ctx = NULL;
@@ -116,96 +115,105 @@
 
     conf_ctx = apache2_worker->conf_ctx;
 
-    if (! conf_ctx)
+    if (!conf_ctx)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_CONFIGURATION_CONTEXT,
-                AXIS2_FAILURE);
+                        AXIS2_FAILURE);
         return AXIS2_CRITICAL_FAILURE;
     }
     content_length = request->remaining;
     http_version = request->protocol;
     req_url = request->unparsed_uri;
 
-    content_type = (axis2_char_t *)apr_table_get(request->headers_in,
-            AXIS2_HTTP_HEADER_CONTENT_TYPE);
+    content_type = (axis2_char_t *) apr_table_get(request->headers_in,
+                                                  AXIS2_HTTP_HEADER_CONTENT_TYPE);
     request->content_type = content_type;
     if (request->read_chunked == AXIS2_TRUE && 0 == content_length)
     {
         content_length = -1;
         request->chunked = 1;
     }
-    if (! http_version)
+    if (!http_version)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_HTTP_VERSION,
-                AXIS2_FAILURE);
+                        AXIS2_FAILURE);
         return AXIS2_CRITICAL_FAILURE;
     }
     out_stream = axutil_stream_create_basic(env);
     AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Client HTTP version %s",
-            http_version);
+                    http_version);
 
-    encoding_header_value = (axis2_char_t*)request->content_encoding;
+    encoding_header_value = (axis2_char_t *) request->content_encoding;
 
-    out_desc =  axis2_conf_get_transport_out( axis2_conf_ctx_get_conf
-            (apache2_worker->conf_ctx, env), env,
-            AXIS2_TRANSPORT_ENUM_HTTP);
-    in_desc =  axis2_conf_get_transport_in( axis2_conf_ctx_get_conf
-            (apache2_worker->conf_ctx, env), env,
-            AXIS2_TRANSPORT_ENUM_HTTP);
+    out_desc = axis2_conf_get_transport_out(axis2_conf_ctx_get_conf
+                                            (apache2_worker->conf_ctx, env),
+                                            env, AXIS2_TRANSPORT_ENUM_HTTP);
+    in_desc =
+        axis2_conf_get_transport_in(axis2_conf_ctx_get_conf
+                                    (apache2_worker->conf_ctx, env), env,
+                                    AXIS2_TRANSPORT_ENUM_HTTP);
 
     msg_ctx = axis2_msg_ctx_create(env, conf_ctx, in_desc, out_desc);
-     axis2_msg_ctx_set_server_side(msg_ctx, env, AXIS2_TRUE);
+    axis2_msg_ctx_set_server_side(msg_ctx, env, AXIS2_TRUE);
 
     axis2_msg_ctx_set_transport_out_stream(msg_ctx, env, out_stream);
 
     ctx_uuid = axutil_uuid_gen(env);
     if (ctx_uuid)
     {
-        axutil_string_t *uuid_str = axutil_string_create_assume_ownership(env, &ctx_uuid);
-         axis2_msg_ctx_set_svc_grp_ctx_id(msg_ctx, env, uuid_str);
+        axutil_string_t *uuid_str =
+            axutil_string_create_assume_ownership(env, &ctx_uuid);
+        axis2_msg_ctx_set_svc_grp_ctx_id(msg_ctx, env, uuid_str);
         axutil_string_free(uuid_str, env);
     }
 
     apache2_out_transport_info = axis2_apache2_out_transport_info_create(env,
-            request);
-    axis2_msg_ctx_set_http_out_transport_info(msg_ctx, env, apache2_out_transport_info);
-
-    soap_action = axutil_string_create(env, 
-            (axis2_char_t *)apr_table_get(request->headers_in,
-            AXIS2_HTTP_HEADER_SOAP_ACTION));
+                                                                         request);
+    axis2_msg_ctx_set_http_out_transport_info(msg_ctx, env,
+                                              apache2_out_transport_info);
+
+    soap_action = axutil_string_create(env,
+                                       (axis2_char_t *) apr_table_get(request->
+                                                                      headers_in,
+                                                                      AXIS2_HTTP_HEADER_SOAP_ACTION));
     request_body = axutil_stream_create_apache2(env, request);
-    if (! request_body)
+    if (!request_body)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error occured in"
-                " creating input stream.");
+                        " creating input stream.");
         return AXIS2_CRITICAL_FAILURE;
     }
     if (M_GET == request->method_number)
     {
         processed = axis2_http_transport_utils_process_http_get_request
-                (env, msg_ctx, request_body, out_stream,
-                        content_type , soap_action,
-                        req_url,
-                        conf_ctx,
-                        axis2_http_transport_utils_get_request_params(env,
-                                (axis2_char_t *)req_url));
+            (env, msg_ctx, request_body, out_stream,
+             content_type, soap_action,
+             req_url,
+             conf_ctx,
+             axis2_http_transport_utils_get_request_params(env,
+                                                           (axis2_char_t *)
+                                                           req_url));
         if (AXIS2_FALSE == processed)
         {
             axis2_char_t *wsdl = NULL;
-            wsdl = strstr ((axis2_char_t *)req_url, AXIS2_REQUEST_WSDL);
+            wsdl = strstr((axis2_char_t *) req_url, AXIS2_REQUEST_WSDL);
             if (wsdl)
             {
-                body_string = axis2_http_transport_utils_get_services_static_wsdl(
-                    env,conf_ctx, (axis2_char_t *)req_url);
+                body_string =
+                    axis2_http_transport_utils_get_services_static_wsdl(env,
+                                                                        conf_ctx,
+                                                                        (axis2_char_t
+                                                                         *)
+                                                                        req_url);
                 request->content_type = "text/xml";
-            
+
             }
             else
             {
                 body_string = axis2_http_transport_utils_get_services_html(env,
-                     conf_ctx);
+                                                                           conf_ctx);
                 request->content_type = "text/html";
-            
+
             }
 
             if (body_string)
@@ -220,23 +228,22 @@
     {
         axis2_status_t status = AXIS2_FAILURE;
         status = axis2_http_transport_utils_process_http_post_request
-                (env, msg_ctx, request_body, out_stream,
-                        content_type , content_length,
-                        soap_action,
-                        (axis2_char_t *)req_url);
+            (env, msg_ctx, request_body, out_stream,
+             content_type, content_length,
+             soap_action, (axis2_char_t *) req_url);
         if (status == AXIS2_FAILURE)
         {
             axis2_msg_ctx_t *fault_ctx = NULL;
             axis2_char_t *fault_code = NULL;
             axis2_engine_t *engine = axis2_engine_create(env, conf_ctx);
-            if (! engine)
+            if (!engine)
             {
                 /* Critical error, cannot proceed, Apache will send default 
                    document for 500
-                */
+                 */
                 return AXIS2_CRITICAL_FAILURE;
             }
-            if ( axis2_msg_ctx_get_is_soap_11 (msg_ctx, env))
+            if (axis2_msg_ctx_get_is_soap_11(msg_ctx, env))
             {
                 fault_code = AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX ":"
                     AXIOM_SOAP11_FAULT_CODE_SENDER;
@@ -246,25 +253,27 @@
                 fault_code = AXIOM_SOAP_DEFAULT_NAMESPACE_PREFIX ":"
                     AXIOM_SOAP12_SOAP_FAULT_VALUE_SENDER;
             }
-            fault_ctx =  axis2_engine_create_fault_msg_ctx(engine, env, msg_ctx,
-                    fault_code, axutil_error_get_message(env->error));
+            fault_ctx = axis2_engine_create_fault_msg_ctx(engine, env, msg_ctx,
+                                                          fault_code,
+                                                          axutil_error_get_message
+                                                          (env->error));
             axis2_engine_send_fault(engine, env, fault_ctx);
             if (out_stream)
             {
                 body_string = axutil_stream_get_buffer(out_stream, env);
                 body_string_len = axutil_stream_get_len(out_stream, env);
             }
-            
+
             /* In case of a SOAP Fault, we have to set the status to 500,
                but still return OK because the module has handled the error 
-            */
-            send_status =  OK;
+             */
+            send_status = OK;
             request->status = HTTP_INTERNAL_SERVER_ERROR;
         }
     }
-    
+
     op_ctx = axis2_msg_ctx_get_op_ctx(msg_ctx, env);
-    
+
     if (-1 == send_status)
     {
         if (axis2_op_ctx_get_response_written(op_ctx, env))
@@ -282,7 +291,7 @@
             request->status = HTTP_ACCEPTED;
         }
     }
-    
+
     if (op_ctx)
     {
         axis2_op_ctx_destroy_mutex(op_ctx, env);
@@ -292,7 +301,7 @@
         ap_rwrite(body_string, body_string_len, request);
         body_string = NULL;
     }
-    
+
     if (request_body)
     {
         axutil_stream_free(request_body, env);
@@ -307,8 +316,8 @@
 
 AXIS2_EXTERN axis2_char_t *AXIS2_CALL
 axis2_apache2_worker_get_bytes(
-    const axutil_env_t *env,
-    axutil_stream_t *stream)
+    const axutil_env_t * env,
+    axutil_stream_t * stream)
 {
 
     axutil_stream_t *tmp_stream = NULL;
@@ -340,20 +349,12 @@
 
     if (return_size > 0)
     {
-        buffer = (char *)AXIS2_MALLOC(env->allocator, sizeof(char) *
-                (return_size + 2));
+        buffer = (char *) AXIS2_MALLOC(env->allocator, sizeof(char) *
+                                       (return_size + 2));
         return_size = axutil_stream_read(tmp_stream, env, buffer,
-                return_size + 1);
+                                         return_size + 1);
         buffer[return_size + 1] = '\0';
     }
     axutil_stream_free(tmp_stream, env);
     return buffer;
 }
-
-
-
-
-
-
-
-

Modified: webservices/axis2/trunk/c/src/core/transport/http/server/apache2/axis2_apache2_out_transport_info.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/apache2/axis2_apache2_out_transport_info.h?rev=580276&r1=580275&r2=580276&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/apache2/axis2_apache2_out_transport_info.h (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/apache2/axis2_apache2_out_transport_info.h Fri Sep 28 02:52:58 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -14,11 +15,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
- 
+
 #ifndef AXIS2_APACHE2_OUT_TRANSPORT_INFO_H
 #define AXIS2_APACHE2_OUT_TRANSPORT_INFO_H
 
-/** 
+/**
  * @ingroup axis2_core_transport_http
  * @{
  */
@@ -32,27 +33,29 @@
 #include <httpd.h>
 
 #ifdef __cplusplus
-extern "C" 
+extern "C"
 {
 #endif
 
-AXIS2_EXTERN axis2_http_out_transport_info_t *AXIS2_CALL 
-axis2_apache2_out_transport_info_create(
-    const axutil_env_t *env,
-    request_rec *r);
+    AXIS2_EXTERN axis2_http_out_transport_info_t *AXIS2_CALL
 
-/**
- * Free http_out_transport_info passed as void pointer. This will be
- * cast into appropriate type and then pass the cast object
- * into the http_out_transport_info structure's free method
- */
-AXIS2_EXTERN void AXIS2_CALL 
-axis2_apache2_out_transport_info_free_void_arg(
-    void *transport_info,
-    const axutil_env_t *env);
+    axis2_apache2_out_transport_info_create(
+        const axutil_env_t * env,
+        request_rec * r);
+
+    /**
+     * Free http_out_transport_info passed as void pointer. This will be
+     * cast into appropriate type and then pass the cast object
+     * into the http_out_transport_info structure's free method
+     */
+    AXIS2_EXTERN void AXIS2_CALL
+
+    axis2_apache2_out_transport_info_free_void_arg(
+        void *transport_info,
+        const axutil_env_t * env);
 
-/** @} */
+    /** @} */
 #ifdef __cplusplus
 }
 #endif
-#endif /* AXIS2_APACHE2_OUT_TRANSPORT_INFO_H */
+#endif                          /* AXIS2_APACHE2_OUT_TRANSPORT_INFO_H */

Modified: webservices/axis2/trunk/c/src/core/transport/http/server/apache2/axis2_apache2_worker.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/apache2/axis2_apache2_worker.h?rev=580276&r1=580275&r2=580276&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/apache2/axis2_apache2_worker.h (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/apache2/axis2_apache2_worker.h Fri Sep 28 02:52:58 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -39,28 +40,29 @@
 #include <axis2_conf_ctx.h>
 #include "apache2_stream.h"
 
-
 #ifdef __cplusplus
 extern "C"
 {
 #endif
 
-
     typedef struct axis2_apache2_worker axis2_apache2_worker_t;
 
     AXIS2_EXTERN int AXIS2_CALL
-    axis2_apache2_worker_process_request(axis2_apache2_worker_t *apache2_worker,
-        const axutil_env_t *env, 
-        request_rec *r);
+    axis2_apache2_worker_process_request(
+        axis2_apache2_worker_t * apache2_worker,
+        const axutil_env_t * env,
+        request_rec * r);
 
     AXIS2_EXTERN void AXIS2_CALL
-    axis2_apache2_worker_free(axis2_apache2_worker_t *apache2_worker,
-        const axutil_env_t *env);
+    axis2_apache2_worker_free(
+        axis2_apache2_worker_t * apache2_worker,
+        const axutil_env_t * env);
+
+    AXIS2_EXTERN axis2_apache2_worker_t *AXIS2_CALL
 
-    AXIS2_EXTERN axis2_apache2_worker_t * AXIS2_CALL
     axis2_apache2_worker_create(
-        const axutil_env_t *env, 
-        axis2_char_t *repo_path);
+        const axutil_env_t * env,
+        axis2_char_t * repo_path);
 
 #define AXIS2_APACHE2_WORKER_PROCESS_REQUEST(apache2_worker, env, request) \
                         axis2_apache2_worker_process_request(\
@@ -68,7 +70,7 @@
 #define AXIS2_APACHE2_WORKER_FREE(apache2_worker, env) \
                 axis2_apache2_worker_free(apache2_worker, env)
 
-/** @} */
+    /** @} */
 #ifdef __cplusplus
 }
 #endif

Modified: webservices/axis2/trunk/c/src/core/transport/http/server/apache2/mod_axis2.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/apache2/mod_axis2.c?rev=580276&r1=580275&r2=580276&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/apache2/mod_axis2.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/apache2/mod_axis2.c Fri Sep 28 02:52:58 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -15,7 +16,6 @@
  * limitations under the License.
  */
 
-
 #include <httpd.h>
 #include <http_config.h>
 #include <http_log.h>
@@ -32,8 +32,8 @@
 /* Configuration structure populated by apache2.conf */
 typedef struct axis2_config_rec
 {
-    char * axutil_log_file;
-    char * axis2_repo_path;
+    char *axutil_log_file;
+    char *axis2_repo_path;
     axutil_log_levels_t log_level;
 }
 axis2_config_rec_t;
@@ -42,91 +42,83 @@
 const axutil_env_t *axutil_env = NULL;
 
 /******************************Function Headers********************************/
-static void *
-axis2_create_svr(
-    apr_pool_t *p,
-    server_rec *s);
+static void *axis2_create_svr(
+    apr_pool_t * p,
+    server_rec * s);
 
-static const char *
-axis2_set_repo_path(
-    cmd_parms *cmd,
+static const char *axis2_set_repo_path(
+    cmd_parms * cmd,
     void *dummy,
     const char *arg);
 
-static const char *
-axis2_set_log_file(
-    cmd_parms *cmd,
+static const char *axis2_set_log_file(
+    cmd_parms * cmd,
     void *dummy,
     const char *arg);
 
-static const char *
-axis2_set_log_level(
-    cmd_parms *cmd,
+static const char *axis2_set_log_level(
+    cmd_parms * cmd,
     void *dummy,
     const char *arg);
 
-static const char *
-axis2_set_svc_url_prefix(
-    cmd_parms *cmd,
+static const char *axis2_set_svc_url_prefix(
+    cmd_parms * cmd,
     void *dummy,
     const char *arg);
 
-static int
-axis2_handler(
-    request_rec *req);
+static int axis2_handler(
+    request_rec * req);
 
-void *AXIS2_CALL
-axis2_module_malloc(
-    axutil_allocator_t *allocator, size_t size);
+void *AXIS2_CALL axis2_module_malloc(
+    axutil_allocator_t * allocator,
+    size_t size);
+
+void *AXIS2_CALL axis2_module_realloc(
+    axutil_allocator_t * allocator,
+    void *ptr,
+    size_t size);
+
+void AXIS2_CALL axis2_module_free(
+    axutil_allocator_t * allocator,
+    void *ptr);
+
+static void axis2_module_init(
+    apr_pool_t * p,
+    server_rec * svr_rec);
 
-void *AXIS2_CALL
-axis2_module_realloc(
-    axutil_allocator_t *allocator, void *ptr, size_t size);
-
-void AXIS2_CALL
-axis2_module_free(
-    axutil_allocator_t *allocator, void *ptr);
-
-static void
-axis2_module_init(
-    apr_pool_t* p,
-    server_rec* svr_rec);
-
-static void
-axis2_register_hooks(
-    apr_pool_t *p);
+static void axis2_register_hooks(
+    apr_pool_t * p);
 
 /***************************End of Function Headers****************************/
 
-static const command_rec axis2_cmds[] =
-    {
-        AP_INIT_TAKE1("Axis2RepoPath", axis2_set_repo_path, NULL, RSRC_CONF,
-                "Axis2/C repository path"),
-        AP_INIT_TAKE1("Axis2LogFile", axis2_set_log_file, NULL, RSRC_CONF,
-                "Axis2/C log file name"),
-        AP_INIT_TAKE1("Axis2LogLevel", axis2_set_log_level, NULL, RSRC_CONF,
-                "Axis2/C log level"),
-        AP_INIT_TAKE1("Axis2ServiceURLPrefix", axis2_set_svc_url_prefix, NULL, RSRC_CONF,
-                "Axis2/C service URL prifix"),
-        {NULL}
-    };
+static const command_rec axis2_cmds[] = {
+    AP_INIT_TAKE1("Axis2RepoPath", axis2_set_repo_path, NULL, RSRC_CONF,
+                  "Axis2/C repository path"),
+    AP_INIT_TAKE1("Axis2LogFile", axis2_set_log_file, NULL, RSRC_CONF,
+                  "Axis2/C log file name"),
+    AP_INIT_TAKE1("Axis2LogLevel", axis2_set_log_level, NULL, RSRC_CONF,
+                  "Axis2/C log level"),
+    AP_INIT_TAKE1("Axis2ServiceURLPrefix", axis2_set_svc_url_prefix, NULL,
+                  RSRC_CONF,
+                  "Axis2/C service URL prifix"),
+    {NULL}
+};
 
 /* Dispatch list for API hooks */
-module AP_MODULE_DECLARE_DATA axis2_module =
-    {
-        STANDARD20_MODULE_STUFF,
-        NULL,                  /* create per-dir    config structures */
-        NULL,                  /* merge  per-dir    config structures */
-        axis2_create_svr,      /* create per-server config structures */
-        NULL,                  /* merge  per-server config structures */
-        axis2_cmds,            /* table of config file commands       */
-        axis2_register_hooks   /* register hooks                      */
-    };
+module AP_MODULE_DECLARE_DATA axis2_module = {
+    STANDARD20_MODULE_STUFF,
+    NULL,                       /* create per-dir    config structures */
+    NULL,                       /* merge  per-dir    config structures */
+    axis2_create_svr,           /* create per-server config structures */
+    NULL,                       /* merge  per-server config structures */
+    axis2_cmds,                 /* table of config file commands       */
+    axis2_register_hooks        /* register hooks                      */
+};
 
 static void *
 axis2_create_svr(
-    apr_pool_t *p,
-    server_rec *s)
+    apr_pool_t * p,
+    server_rec * s)
 {
     axis2_config_rec_t *conf = apr_palloc(p, sizeof(*conf));
     conf->axutil_log_file = NULL;
@@ -137,58 +129,61 @@
 
 static const char *
 axis2_set_repo_path(
-    cmd_parms *cmd,
+    cmd_parms * cmd,
     void *dummy,
     const char *arg)
 {
-	axis2_config_rec_t *conf = NULL;		
+    axis2_config_rec_t *conf = NULL;
     const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
     if (err != NULL)
     {
         return err;
     }
-    conf = (axis2_config_rec_t*)ap_get_module_config(
-                cmd->server->module_config, &axis2_module);
+    conf =
+        (axis2_config_rec_t *) ap_get_module_config(cmd->server->module_config,
+                                                    &axis2_module);
     conf->axis2_repo_path = apr_pstrdup(cmd->pool, arg);
     return NULL;
 }
 
 static const char *
 axis2_set_log_file(
-    cmd_parms *cmd,
+    cmd_parms * cmd,
     void *dummy,
     const char *arg)
 {
-	axis2_config_rec_t *conf = NULL;		
+    axis2_config_rec_t *conf = NULL;
     const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
     if (err != NULL)
     {
         return err;
     }
 
-    conf = (axis2_config_rec_t*)ap_get_module_config(
-                cmd->server->module_config, &axis2_module);
+    conf =
+        (axis2_config_rec_t *) ap_get_module_config(cmd->server->module_config,
+                                                    &axis2_module);
     conf->axutil_log_file = apr_pstrdup(cmd->pool, arg);
     return NULL;
 }
 
 static const char *
 axis2_set_log_level(
-    cmd_parms *cmd,
+    cmd_parms * cmd,
     void *dummy,
     const char *arg)
 {
     char *str;
     axutil_log_levels_t level = AXIS2_LOG_LEVEL_DEBUG;
-	axis2_config_rec_t *conf = NULL;
-	const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
+    axis2_config_rec_t *conf = NULL;
+    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
     if (err != NULL)
     {
         return err;
     }
 
-    conf = (axis2_config_rec_t*)ap_get_module_config(
-                cmd->server->module_config, &axis2_module);
+    conf =
+        (axis2_config_rec_t *) ap_get_module_config(cmd->server->module_config,
+                                                    &axis2_module);
 
     if ((str = ap_getword_conf(cmd->pool, &arg)))
     {
@@ -223,13 +218,13 @@
 
 static const char *
 axis2_set_svc_url_prefix(
-    cmd_parms *cmd,
+    cmd_parms * cmd,
     void *dummy,
     const char *arg)
 {
     AXIS2_IMPORT extern axis2_char_t *axis2_request_url_prefix;
     const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
-    
+
     axis2_request_url_prefix = AXIS2_REQUEST_URL_PREFIX;
     if (!err)
     {
@@ -244,42 +239,45 @@
 /* The sample content handler */
 static int
 axis2_handler(
-    request_rec *req)
+    request_rec * req)
 {
     int rv = 0;
-    
+
     if (strcmp(req->handler, "axis2_module"))
     {
         return DECLINED;
     }
-    /* Set up the read policy from the client.*/
+    /* Set up the read policy from the client. */
     if ((rv = ap_setup_client_block(req, REQUEST_CHUNKED_DECHUNK)) != OK)
     {
         return rv;
     }
     ap_should_client_block(req);
 
-    axutil_env->allocator->current_pool = (void*) req->pool;
+    axutil_env->allocator->current_pool = (void *) req->pool;
     rv = AXIS2_APACHE2_WORKER_PROCESS_REQUEST(axis2_worker, axutil_env, req);
 
     if (AXIS2_CRITICAL_FAILURE == rv)
     {
         return HTTP_INTERNAL_SERVER_ERROR;
     }
-    
+
     return rv;
 }
 
-void * AXIS2_CALL
+void *AXIS2_CALL
 axis2_module_malloc(
-    axutil_allocator_t *allocator, size_t size)
+    axutil_allocator_t * allocator,
+    size_t size)
 {
-    return apr_palloc((apr_pool_t*) (allocator->current_pool), size);
+    return apr_palloc((apr_pool_t *) (allocator->current_pool), size);
 }
 
-void * AXIS2_CALL
+void *AXIS2_CALL
 axis2_module_realloc(
-    axutil_allocator_t *allocator, void *ptr, size_t size)
+    axutil_allocator_t * allocator,
+    void *ptr,
+    size_t size)
 {
     /* can't be easily implemented */
     return NULL;
@@ -287,14 +285,15 @@
 
 void AXIS2_CALL
 axis2_module_free(
-    axutil_allocator_t *allocator, void *ptr)
+    axutil_allocator_t * allocator,
+    void *ptr)
 {
 }
 
 static void
 axis2_module_init(
-    apr_pool_t* p,
-    server_rec* svr_rec)
+    apr_pool_t * p,
+    server_rec * svr_rec)
 {
     apr_pool_t *pool;
     apr_status_t status;
@@ -302,8 +301,9 @@
     axutil_error_t *error = NULL;
     axutil_log_t *axutil_logger = NULL;
     axutil_thread_pool_t *thread_pool = NULL;
-    axis2_config_rec_t *conf = (axis2_config_rec_t*)ap_get_module_config(
-                svr_rec->module_config, &axis2_module);
+    axis2_config_rec_t *conf =
+        (axis2_config_rec_t *) ap_get_module_config(svr_rec->module_config,
+                                                    &axis2_module);
 
     /* We need to init xml readers before we go into threaded env
      */
@@ -319,9 +319,9 @@
                      "[Axis2] Error allocating mod_axis2 memory pool");
         exit(APEXIT_CHILDFATAL);
     }
-    allocator = (axutil_allocator_t*) apr_palloc(pool,
-                                                sizeof(axutil_allocator_t));
-    if (! allocator)
+    allocator = (axutil_allocator_t *) apr_palloc(pool,
+                                                  sizeof(axutil_allocator_t));
+    if (!allocator)
     {
         ap_log_error(APLOG_MARK, APLOG_EMERG, APR_ENOMEM, svr_rec,
                      "[Axis2] Error allocating mod_axis2 allocator");
@@ -330,43 +330,44 @@
     allocator->malloc_fn = axis2_module_malloc;
     allocator->realloc = axis2_module_realloc;
     allocator->free_fn = axis2_module_free;
-    allocator->local_pool = (void*) pool;
-    allocator->current_pool = (void*) pool;
-    allocator->global_pool = (void*) pool;
+    allocator->local_pool = (void *) pool;
+    allocator->current_pool = (void *) pool;
+    allocator->global_pool = (void *) pool;
 
-    if (! allocator)
+    if (!allocator)
     {
         ap_log_error(APLOG_MARK, APLOG_EMERG, APR_EGENERAL, svr_rec,
-                         "[Axis2] Error initializing mod_axis2 allocator");
+                     "[Axis2] Error initializing mod_axis2 allocator");
         exit(APEXIT_CHILDFATAL);
     }
-    
+
     axutil_error_init();
-    
+
     error = axutil_error_create(allocator);
-    if (! error)
+    if (!error)
     {
         ap_log_error(APLOG_MARK, APLOG_EMERG, APR_EGENERAL, svr_rec,
                      "[Axis2] Error creating mod_axis2 error structure");
         exit(APEXIT_CHILDFATAL);
     }
     axutil_logger = axutil_log_create(allocator, NULL, conf->axutil_log_file);
-    if (! axutil_logger)
+    if (!axutil_logger)
     {
         ap_log_error(APLOG_MARK, APLOG_EMERG, APR_EGENERAL, svr_rec,
                      "[Axis2] Error creating mod_axis2 log structure");
         exit(APEXIT_CHILDFATAL);
     }
     thread_pool = axutil_thread_pool_init(allocator);
-    if (! thread_pool)
+    if (!thread_pool)
     {
         ap_log_error(APLOG_MARK, APLOG_EMERG, APR_EGENERAL, svr_rec,
                      "[Axis2] Error initializing mod_axis2 thread pool");
         exit(APEXIT_CHILDFATAL);
     }
     axutil_env = axutil_env_create_with_error_log_thread_pool(allocator, error,
-            axutil_logger, thread_pool);
-    if (! axutil_env)
+                                                              axutil_logger,
+                                                              thread_pool);
+    if (!axutil_env)
     {
         ap_log_error(APLOG_MARK, APLOG_EMERG, APR_EGENERAL, svr_rec,
                      "[Axis2] Error creating mod_axis2 environment");
@@ -376,14 +377,14 @@
     {
 
         axutil_logger->level = conf->log_level;
-        AXIS2_LOG_INFO(axutil_env->log, "Apache Axis2/C version in use : %s", 
-            axis2_version_string());
+        AXIS2_LOG_INFO(axutil_env->log, "Apache Axis2/C version in use : %s",
+                       axis2_version_string());
         AXIS2_LOG_INFO(axutil_env->log, "Starting log with log level %d",
-            conf->log_level);
+                       conf->log_level);
     }
     axis2_worker = axis2_apache2_worker_create(axutil_env,
-            conf->axis2_repo_path);
-    if (! axis2_worker)
+                                               conf->axis2_repo_path);
+    if (!axis2_worker)
     {
         ap_log_error(APLOG_MARK, APLOG_EMERG, APR_EGENERAL, svr_rec,
                      "[Axis2] Error creating mod_axis2 apache2 worker");
@@ -393,10 +394,8 @@
 
 static void
 axis2_register_hooks(
-    apr_pool_t *p)
+    apr_pool_t * p)
 {
     ap_hook_handler(axis2_handler, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_child_init(axis2_module_init, NULL, NULL, APR_HOOK_MIDDLE);
 }
-
-

Modified: webservices/axis2/trunk/c/src/core/transport/http/server/simple_axis2_server/http_server_main.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/simple_axis2_server/http_server_main.c?rev=580276&r1=580275&r2=580276&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/simple_axis2_server/http_server_main.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/simple_axis2_server/http_server_main.c Fri Sep 28 02:52:58 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -33,18 +34,18 @@
 axis2_transport_receiver_t *server = NULL;
 AXIS2_IMPORT extern int axis2_http_socket_read_timeout;
 AXIS2_IMPORT extern axis2_char_t *axis2_request_url_prefix;
+
 /***************************** Function headers *******************************/
-axutil_env_t *
-init_syetem_env(
-    axutil_allocator_t *allocator,
-    const axis2_char_t *log_file);
+axutil_env_t *init_syetem_env(
+    axutil_allocator_t * allocator,
+    const axis2_char_t * log_file);
 
 void system_exit(
-    axutil_env_t *env,
+    axutil_env_t * env,
     int status);
 
 void usage(
-    axis2_char_t *prog_name);
+    axis2_char_t * prog_name);
 
 void sig_handler(
     int signal);
@@ -52,12 +53,13 @@
 /***************************** End of function headers ************************/
 axutil_env_t *
 init_syetem_env(
-    axutil_allocator_t *allocator,
-    const axis2_char_t *log_file)
+    axutil_allocator_t * allocator,
+    const axis2_char_t * log_file)
 {
     axutil_error_t *error = axutil_error_create(allocator);
     axutil_log_t *log = axutil_log_create(allocator, NULL, log_file);
-	 /* if (!log) */
+    /* if (!log) */
+
 /* 		  log = axutil_log_create_default (allocator); */
     axutil_thread_pool_t *thread_pool = axutil_thread_pool_init(allocator);
     /* We need to init the parser in main thread before spawning child
@@ -65,29 +67,31 @@
      */
     axiom_xml_reader_init();
     return axutil_env_create_with_error_log_thread_pool(allocator, error, log,
-            thread_pool);
+                                                        thread_pool);
 }
 
-void system_exit(
-    axutil_env_t *env,
+void
+system_exit(
+    axutil_env_t * env,
     int status)
 {
     axutil_allocator_t *allocator = NULL;
     if (server)
     {
-        axis2_transport_receiver_free(server,  system_env);
+        axis2_transport_receiver_free(server, system_env);
     }
     if (env)
     {
         allocator = env->allocator;
         axutil_env_free(env);
     }
-    /*axutil_allocator_free(allocator);*/
+    /*axutil_allocator_free(allocator); */
     axiom_xml_reader_cleanup();
     exit(status);
 }
 
-int main(
+int
+main(
     int argc,
     char *argv[])
 {
@@ -105,49 +109,48 @@
        set with AXIS2_REQUEST_URL_PREFIX macro at compile time */
     axis2_request_url_prefix = AXIS2_REQUEST_URL_PREFIX;
 
-
     while ((c = AXIS2_GETOPT(argc, argv, ":p:r:ht:l:f:")) != -1)
     {
 
         switch (c)
         {
-            case 'p':
-                port = AXIS2_ATOI(optarg);
-                break;
-            case 'r':
-                repo_path = optarg;
-                break;
-            case 't':
-                axis2_http_socket_read_timeout = AXIS2_ATOI(optarg) * 1000;
-                break;
-            case 'l':
-                log_level = AXIS2_ATOI(optarg);
-                if (log_level < AXIS2_LOG_LEVEL_CRITICAL)
-                    log_level = AXIS2_LOG_LEVEL_CRITICAL;
-                if (log_level > AXIS2_LOG_LEVEL_TRACE)
-                    log_level = AXIS2_LOG_LEVEL_TRACE;
-                break;
-            case 'f':
-                log_file = optarg;
-                break;
-            case 'h':
-                usage(argv[0]);
-                return 0;
-            case ':':
-                fprintf(stderr, "\nOption -%c requires an operand\n", optopt);
-                usage(argv[0]);
-                return -1;
-            case '?':
-                if (isprint(optopt))
-                    fprintf(stderr, "\nUnknown option `-%c'.\n", optopt);
-                usage(argv[0]);
-                return -1;
+        case 'p':
+            port = AXIS2_ATOI(optarg);
+            break;
+        case 'r':
+            repo_path = optarg;
+            break;
+        case 't':
+            axis2_http_socket_read_timeout = AXIS2_ATOI(optarg) * 1000;
+            break;
+        case 'l':
+            log_level = AXIS2_ATOI(optarg);
+            if (log_level < AXIS2_LOG_LEVEL_CRITICAL)
+                log_level = AXIS2_LOG_LEVEL_CRITICAL;
+            if (log_level > AXIS2_LOG_LEVEL_TRACE)
+                log_level = AXIS2_LOG_LEVEL_TRACE;
+            break;
+        case 'f':
+            log_file = optarg;
+            break;
+        case 'h':
+            usage(argv[0]);
+            return 0;
+        case ':':
+            fprintf(stderr, "\nOption -%c requires an operand\n", optopt);
+            usage(argv[0]);
+            return -1;
+        case '?':
+            if (isprint(optopt))
+                fprintf(stderr, "\nUnknown option `-%c'.\n", optopt);
+            usage(argv[0]);
+            return -1;
         }
     }
 
     allocator = axutil_allocator_init(NULL);
 
-    if (! allocator)
+    if (!allocator)
     {
         system_exit(NULL, -1);
     }
@@ -164,33 +167,38 @@
 #endif
 
     AXIS2_LOG_INFO(env->log, "Starting Axis2 HTTP server....");
-    AXIS2_LOG_INFO(env->log, "Apache Axis2/C version in use : %s", axis2_version_string());
+    AXIS2_LOG_INFO(env->log, "Apache Axis2/C version in use : %s",
+                   axis2_version_string());
     AXIS2_LOG_INFO(env->log, "Server port : %d", port);
     AXIS2_LOG_INFO(env->log, "Repo location : %s", repo_path);
-    AXIS2_LOG_INFO(env->log, "Read Timeout : %d ms", axis2_http_socket_read_timeout);
+    AXIS2_LOG_INFO(env->log, "Read Timeout : %d ms",
+                   axis2_http_socket_read_timeout);
 
     server = axis2_http_server_create(env, repo_path, port);
-    if (! server)
+    if (!server)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Server creation failed: Error code:"
-                " %d :: %s", env->error->error_number,
-                AXIS2_ERROR_GET_MESSAGE(env->error));
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                        "Server creation failed: Error code:" " %d :: %s",
+                        env->error->error_number,
+                        AXIS2_ERROR_GET_MESSAGE(env->error));
         system_exit(env, -1);
 
     }
     printf("Started Simple Axis2 HTTP Server ...\n");
     if (axis2_transport_receiver_start(server, env) == AXIS2_FAILURE)
     {
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Server start failed: Error code:"
-                " %d :: %s", env->error->error_number,
-                AXIS2_ERROR_GET_MESSAGE(env->error));
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI,
+                        "Server start failed: Error code:" " %d :: %s",
+                        env->error->error_number,
+                        AXIS2_ERROR_GET_MESSAGE(env->error));
         system_exit(env, -1);
     }
     return 0;
 }
 
-void usage(
-    axis2_char_t *prog_name)
+void
+usage(
+    axis2_char_t * prog_name)
 {
     fprintf(stdout, "\n Usage : %s", prog_name);
     fprintf(stdout, " [-p PORT]");
@@ -201,12 +209,15 @@
     fprintf(stdout, " Options :\n");
     fprintf(stdout, "\t-p PORT \t port number to use, default port is 9090\n");
     fprintf(stdout, "\t-r REPO_PATH \t repository path, default is ../\n");
-    fprintf(stdout, "\t-t TIMEOUT\t socket read timeout, default is 30 seconds\n");
-    fprintf(stdout, "\t-l LOG_LEVEL\t log level, available log levels:"
-            "\n\t\t\t 0 - critical    1 - errors 2 - warnings" 
+    fprintf(stdout,
+            "\t-t TIMEOUT\t socket read timeout, default is 30 seconds\n");
+    fprintf(stdout,
+            "\t-l LOG_LEVEL\t log level, available log levels:"
+            "\n\t\t\t 0 - critical    1 - errors 2 - warnings"
             "\n\t\t\t 3 - information 4 - debug  5- trace"
             "\n\t\t\t Default log level is 4(debug).\n");
-    fprintf(stdout, "\t-f LOG_FILE\t log file, default is $AXIS2C_HOME/logs/axis2.log"
+    fprintf(stdout,
+            "\t-f LOG_FILE\t log file, default is $AXIS2C_HOME/logs/axis2.log"
             "\n\t\t\t or axis2.log in current folder if AXIS2C_HOME not set\n");
     fprintf(stdout, " Help :\n\t-h \t display this help screen.\n\n");
 }
@@ -216,26 +227,27 @@
  */
 #ifndef WIN32
 
-void sig_handler(
+void
+sig_handler(
     int signal)
 {
     switch (signal)
     {
-        case SIGINT :
+    case SIGINT:
         {
             AXIS2_LOG_INFO(system_env->log, "Received signal SIGINT. Server "
-                    "shutting down");
+                           "shutting down");
             axis2_http_server_stop(server, system_env);
             AXIS2_LOG_INFO(system_env->log, "Shutdown complete ...");
             system_exit(system_env, 0);
         }
-        case SIGPIPE :
+    case SIGPIPE:
         {
             AXIS2_LOG_INFO(system_env->log, "Received signal SIGPIPE.  Client "
-                    "request serve aborted");
+                           "request serve aborted");
             return;
         }
-        case SIGSEGV :
+    case SIGSEGV:
         {
             fprintf(stderr, "Received deadly signal SIGSEGV. Terminating\n");
             _exit(-1);

Modified: webservices/axis2/trunk/c/src/core/transport/http/util/http_chunked_stream.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/util/http_chunked_stream.c?rev=580276&r1=580275&r2=580276&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/util/http_chunked_stream.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/util/http_chunked_stream.c Fri Sep 28 02:52:58 2007
@@ -1,3 +1,4 @@
+
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -30,25 +31,23 @@
     axis2_bool_t chunk_started;
 };
 
-static axis2_status_t
-axis2_http_chunked_stream_start_chunk(
-    axis2_http_chunked_stream_t *chunked_stream,
-    const axutil_env_t *env);
+static axis2_status_t axis2_http_chunked_stream_start_chunk(
+    axis2_http_chunked_stream_t * chunked_stream,
+    const axutil_env_t * env);
 
 AXIS2_EXTERN axis2_http_chunked_stream_t *AXIS2_CALL
 axis2_http_chunked_stream_create(
-    const axutil_env_t *env,
-    axutil_stream_t *stream)
+    const axutil_env_t * env,
+    axutil_stream_t * stream)
 {
     axis2_http_chunked_stream_t *chunked_stream = NULL;
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, stream, NULL);
 
-    chunked_stream = (axis2_http_chunked_stream_t *)AXIS2_MALLOC
-            (env->allocator, sizeof(
-                        axis2_http_chunked_stream_t));
+    chunked_stream = (axis2_http_chunked_stream_t *) AXIS2_MALLOC
+        (env->allocator, sizeof(axis2_http_chunked_stream_t));
 
-    if (! chunked_stream)
+    if (!chunked_stream)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -64,8 +63,8 @@
 
 AXIS2_EXTERN void AXIS2_CALL
 axis2_http_chunked_stream_free(
-    axis2_http_chunked_stream_t *chunked_stream,
-    const axutil_env_t *env)
+    axis2_http_chunked_stream_t * chunked_stream,
+    const axutil_env_t * env)
 {
     AXIS2_ENV_CHECK(env, void);
 
@@ -75,8 +74,8 @@
 
 AXIS2_EXTERN int AXIS2_CALL
 axis2_http_chunked_stream_read(
-    axis2_http_chunked_stream_t *chunked_stream,
-    const axutil_env_t *env,
+    axis2_http_chunked_stream_t * chunked_stream,
+    const axutil_env_t * env,
     void *buffer,
     size_t count)
 {
@@ -85,14 +84,14 @@
     axutil_stream_t *stream = chunked_stream->stream;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    if (! buffer)
+    if (!buffer)
     {
         return -1;
     }
-    if (! stream)
+    if (!stream)
     {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_STREAM_IN_CHUNKED_STREAM
-                , AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_STREAM_IN_CHUNKED_STREAM,
+                        AXIS2_FAILURE);
         return -1;
     }
     if (AXIS2_TRUE == chunked_stream->end_of_chunks)
@@ -109,8 +108,8 @@
         if (chunked_stream->unread_len < yet_to_read)
         {
             len = axutil_stream_read(chunked_stream->stream, env,
-                    (axis2_char_t *)buffer + count - yet_to_read,
-                    chunked_stream->unread_len);
+                                     (axis2_char_t *) buffer + count -
+                                     yet_to_read, chunked_stream->unread_len);
             yet_to_read -= len;
             chunked_stream->unread_len -= len;
             if (chunked_stream->unread_len <= 0)
@@ -121,8 +120,8 @@
         else
         {
             len = axutil_stream_read(chunked_stream->stream, env,
-                    (axis2_char_t *)buffer + count - yet_to_read,
-                    yet_to_read);
+                                     (axis2_char_t *) buffer + count -
+                                     yet_to_read, yet_to_read);
             yet_to_read -= len;
             chunked_stream->unread_len -= len;
         }
@@ -132,8 +131,8 @@
 
 AXIS2_EXTERN int AXIS2_CALL
 axis2_http_chunked_stream_write(
-    axis2_http_chunked_stream_t *chunked_stream,
-    const axutil_env_t *env,
+    axis2_http_chunked_stream_t * chunked_stream,
+    const axutil_env_t * env,
     const void *buffer,
     size_t count)
 {
@@ -142,37 +141,35 @@
     axis2_char_t tmp_buf[10];
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
 
-    if (! buffer)
+    if (!buffer)
     {
         return -1;
     }
-    if (! stream)
+    if (!stream)
     {
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_STREAM_IN_CHUNKED_STREAM
-                , AXIS2_FAILURE);
+        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_STREAM_IN_CHUNKED_STREAM,
+                        AXIS2_FAILURE);
         return -1;
     }
-    sprintf(tmp_buf, "%x%s", (unsigned int)count, AXIS2_HTTP_CRLF);
+    sprintf(tmp_buf, "%x%s", (unsigned int) count, AXIS2_HTTP_CRLF);
     len = axutil_stream_write(stream, env, tmp_buf, axutil_strlen(tmp_buf));
     len = axutil_stream_write(stream, env, buffer, count);
     axutil_stream_write(stream, env, AXIS2_HTTP_CRLF, 2);
     return len;
 }
 
-
 AXIS2_EXTERN int AXIS2_CALL
 axis2_http_chunked_stream_get_current_chunk_size(
-    const axis2_http_chunked_stream_t *chunked_stream,
-    const axutil_env_t *env)
+    const axis2_http_chunked_stream_t * chunked_stream,
+    const axutil_env_t * env)
 {
     return chunked_stream->current_chunk_size;
 }
 
-
 static axis2_status_t
 axis2_http_chunked_stream_start_chunk(
-    axis2_http_chunked_stream_t *chunked_stream,
-    const axutil_env_t *env)
+    axis2_http_chunked_stream_t * chunked_stream,
+    const axutil_env_t * env)
 {
     axis2_char_t tmp_buf[3] = "";
     axis2_char_t str_chunk_len[512] = "";
@@ -188,7 +185,7 @@
     }
     /* read the len and chunk extension */
     while ((read = axutil_stream_read(chunked_stream->stream, env, tmp_buf,
-            1)) > 0)
+                                      1)) > 0)
     {
         tmp_buf[read] = '\0';
         strcat(str_chunk_len, tmp_buf);
@@ -214,16 +211,15 @@
     else
     {
         chunked_stream->chunk_started = AXIS2_TRUE;
-        chunked_stream->unread_len =
-            chunked_stream->current_chunk_size;
+        chunked_stream->unread_len = chunked_stream->current_chunk_size;
     }
     return AXIS2_SUCCESS;
 }
 
 AXIS2_EXTERN axis2_status_t AXIS2_CALL
 axis2_http_chunked_stream_write_last_chunk(
-    axis2_http_chunked_stream_t *chunked_stream,
-    const axutil_env_t *env)
+    axis2_http_chunked_stream_t * chunked_stream,
+    const axutil_env_t * env)
 {
     axutil_stream_t *stream = NULL;
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org