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 [24/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/server/CGI/axis2_cgi_stream.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/CGI/axis2_cgi_stream.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/CGI/axis2_cgi_stream.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/CGI/axis2_cgi_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
@@ -31,12 +30,12 @@
     axutil_stream_type_t stream_type;
     unsigned int cur_pos;
     unsigned int content_length;
-}
-cgi_stream_impl_t;
+} cgi_stream_impl_t;
 
 #define AXIS2_INTF_TO_IMPL(stream) ((cgi_stream_impl_t *)(stream))
 
-axutil_stream_type_t AXIS2_CALL cgi_stream_get_type(
+axutil_stream_type_t AXIS2_CALL
+cgi_stream_get_type(
     axutil_stream_t * stream,
     const axutil_env_t * env);
 
@@ -64,22 +63,20 @@
 axutil_stream_t *AXIS2_CALL
 axutil_stream_create_cgi(
     const axutil_env_t * env,
-	unsigned int content_length)
+    unsigned int content_length)
 {
     cgi_stream_impl_t *stream_impl = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-	AXIS2_PARAM_CHECK(env->error, content_length, NULL);
+    AXIS2_PARAM_CHECK(env->error, content_length, NULL);
 
-    stream_impl =
-        (cgi_stream_impl_t *) AXIS2_MALLOC(env->allocator,
-                                           sizeof(cgi_stream_impl_t));
+    stream_impl = (cgi_stream_impl_t *)AXIS2_MALLOC(env->allocator, sizeof(cgi_stream_impl_t));
 
-    if (!stream_impl)
+    if(!stream_impl)
     {
         return NULL;
     }
     stream_impl->cur_pos = 0;
-	stream_impl->content_length = content_length;
+    stream_impl->content_length = content_length;
     stream_impl->stream_type = AXIS2_STREAM_MANAGED;
 
     axutil_stream_set_read(&(stream_impl->stream), env, cgi_stream_read);
@@ -98,22 +95,22 @@
     /*void *temp_buff = NULL;*/
     /*unsigned int data_to_read = 0;*/
     unsigned int read_bytes = 0;
-	/*axis2_bool_t ret_ok = AXIS2_TRUE;*/
+    /*axis2_bool_t ret_ok = AXIS2_TRUE;*/
 
     cgi_stream_impl_t *stream_impl = NULL;
     /*char *temp = NULL;*/
 
     AXIS2_ENV_CHECK(env, AXIS2_CRITICAL_FAILURE);
-    stream_impl = (cgi_stream_impl_t *) stream;
-	
-	if (count < stream_impl->content_length)
-	{
-		read_bytes = fread(buffer, sizeof(char), count, stdin);
-	}
-	else
-	{
-		read_bytes = fread(buffer, sizeof(char), stream_impl->content_length, stdin);
-	}
+    stream_impl = (cgi_stream_impl_t *)stream;
+
+    if(count < stream_impl->content_length)
+    {
+        read_bytes = fread(buffer, sizeof(char), count, stdin);
+    }
+    else
+    {
+        read_bytes = fread(buffer, sizeof(char), stream_impl->content_length, stdin);
+    }
 
     return read_bytes;
 }
@@ -124,10 +121,10 @@
     const axutil_env_t * env,
     const void *buf,
     size_t count)
-{	
-	/* Cannot write on cgi stdin, explicitly an input stream */
+{
+    /* Cannot write on cgi stdin, explicitly an input stream */
 
-	return -1;
+    return -1;
 }
 
 int AXIS2_CALL
@@ -136,12 +133,13 @@
     const axutil_env_t * env,
     int count)
 {
-	cgi_stream_impl_t *stream_impl = NULL;
+    cgi_stream_impl_t *stream_impl = NULL;
     int skipped = -1;
     AXIS2_ENV_CHECK(env, AXIS2_CRITICAL_FAILURE);
     stream_impl = AXIS2_INTF_TO_IMPL(stream);
-	
-	if (fseek(stdin, count, SEEK_CUR)==0) skipped = count;
+
+    if(fseek(stdin, count, SEEK_CUR) == 0)
+        skipped = count;
     return skipped;
 }
 

Modified: webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_out_transport_info.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_out_transport_info.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_out_transport_info.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_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
@@ -48,7 +47,7 @@
 
     info = AXIS2_INTF_TO_IMPL(out_transport_info);
 
-    if (info->encoding)
+    if(info->encoding)
     {
         AXIS2_FREE(env->allocator, info->encoding);
         info->encoding = NULL;
@@ -66,7 +65,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;
 }
@@ -81,10 +80,9 @@
 
     info_impl = AXIS2_INTF_TO_IMPL(info);
     info_impl->content_type[0] = '\0';
-    if (info_impl->encoding)
+    if(info_impl->encoding)
     {
-        sprintf(info_impl->content_type, "%s%s%s", content_type, ";charser:",
-                info_impl->encoding);
+        sprintf(info_impl->content_type, "%s%s%s", content_type, ";charser:", info_impl->encoding);
     }
     else
     {
@@ -105,7 +103,7 @@
 
     info_impl = AXIS2_INTF_TO_IMPL(info);
 
-    if (info_impl->encoding)
+    if(info_impl->encoding)
     {
         AXIS2_FREE(env->allocator, info_impl->encoding);
     }
@@ -123,10 +121,10 @@
     axis2_http_out_transport_info_t *http_out_info = NULL;
     AXIS2_ENV_CHECK(env, NULL);
 
-    info = (axis2_iis_out_transport_info_t *) AXIS2_MALLOC
-        (env->allocator, sizeof(axis2_iis_out_transport_info_t));
+    info = (axis2_iis_out_transport_info_t *)AXIS2_MALLOC(env->allocator,
+        sizeof(axis2_iis_out_transport_info_t));
 
-    if (!info)
+    if(!info)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -135,13 +133,12 @@
 
     http_out_info = &(info->out_transport_info);
 
-    axis2_http_out_transport_info_set_content_type_func(http_out_info,
-                                                        env,
-                                                        axis2_iis_out_transport_info_set_content_type);
+    axis2_http_out_transport_info_set_content_type_func(http_out_info, env,
+        axis2_iis_out_transport_info_set_content_type);
     axis2_http_out_transport_info_set_char_encoding_func(http_out_info, env,
-                                                         axis2_iis_out_transport_info_set_char_encoding);
+        axis2_iis_out_transport_info_set_char_encoding);
     axis2_http_out_transport_info_set_free_func(http_out_info, env,
-                                                axis2_iis_out_transport_info_free);
+        axis2_iis_out_transport_info_free);
 
     return http_out_info;
 }

Modified: webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_stream.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_stream.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_stream.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_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
@@ -33,12 +32,12 @@
     LPEXTENSION_CONTROL_BLOCK lpECB;
     unsigned int cur_pos;
     void *cur_position;
-}
-iis_stream_impl_t;
+} iis_stream_impl_t;
 
 #define AXIS2_INTF_TO_IMPL(stream) ((iis_stream_impl_t *)(stream))
 
-axutil_stream_type_t AXIS2_CALL iis_stream_get_type(
+axutil_stream_type_t AXIS2_CALL
+iis_stream_get_type(
     axutil_stream_t * stream,
     const axutil_env_t * env);
 
@@ -72,11 +71,9 @@
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, lpECB, NULL);
 
-    stream_impl =
-        (iis_stream_impl_t *) AXIS2_MALLOC(env->allocator,
-                                           sizeof(iis_stream_impl_t));
+    stream_impl = (iis_stream_impl_t *)AXIS2_MALLOC(env->allocator, sizeof(iis_stream_impl_t));
 
-    if (!stream_impl)
+    if(!stream_impl)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -103,25 +100,24 @@
     void *temp_buff = NULL;
     unsigned int data_to_read = 0;
     DWORD ret_val = TRUE;
-    DWORD read_bytes = (DWORD) count;
+    DWORD read_bytes = (DWORD)count;
     iis_stream_impl_t *stream_impl = NULL;
     char *temp = NULL;
 
     AXIS2_ENV_CHECK(env, AXIS2_CRITICAL_FAILURE);
-    stream_impl = (iis_stream_impl_t *) stream;
-    
-    if (stream_impl->cur_pos == 0)
+    stream_impl = (iis_stream_impl_t *)stream;
+
+    if(stream_impl->cur_pos == 0)
         stream_impl->cur_position = stream_impl->lpECB->lpbData;
 
     /* If this is the case all the bytes are in the lpECB->lpbData buffer*/
-    if (stream_impl->lpECB->cbAvailable == stream_impl->lpECB->cbTotalBytes)
+    if(stream_impl->lpECB->cbAvailable == stream_impl->lpECB->cbTotalBytes)
     {
         /* Cannot read more than in the buffer.*/
-        if (count + stream_impl->cur_pos <= stream_impl->lpECB->cbAvailable)
-            data_to_read = (unsigned) count;
+        if(count + stream_impl->cur_pos <= stream_impl->lpECB->cbAvailable)
+            data_to_read = (unsigned)count;
         else
-            data_to_read =
-                stream_impl->lpECB->cbTotalBytes - stream_impl->cur_pos;
+            data_to_read = stream_impl->lpECB->cbTotalBytes - stream_impl->cur_pos;
 
         memcpy(buffer, stream_impl->cur_position, data_to_read);
         temp = (char *)(stream_impl->cur_position);
@@ -131,48 +127,41 @@
         stream_impl->cur_pos += data_to_read;
         read_bytes = data_to_read;
     }
-    else if (stream_impl->lpECB->cbAvailable == -1)
+    else if(stream_impl->lpECB->cbAvailable == -1)
     {
-        ret_val =
-            stream_impl->lpECB->ReadClient(stream_impl->lpECB->ConnID, buffer,
-                                           &read_bytes);
+        ret_val = stream_impl->lpECB->ReadClient(stream_impl->lpECB->ConnID, buffer, &read_bytes);
     }
-    else if (stream_impl->lpECB->cbAvailable < stream_impl->lpECB->cbTotalBytes)
+    else if(stream_impl->lpECB->cbAvailable < stream_impl->lpECB->cbTotalBytes)
     {
-        if (stream_impl->cur_pos > stream_impl->lpECB->cbAvailable)
+        if(stream_impl->cur_pos > stream_impl->lpECB->cbAvailable)
         {
-            ret_val =
-                stream_impl->lpECB->ReadClient(stream_impl->lpECB->ConnID,
-                                               buffer, &read_bytes);
+            ret_val = stream_impl->lpECB->ReadClient(stream_impl->lpECB->ConnID, buffer,
+                &read_bytes);
         }
-        else if (stream_impl->cur_pos + count > stream_impl->lpECB->cbAvailable
-                 && stream_impl->cur_pos < stream_impl->lpECB->cbAvailable)
+        else if(stream_impl->cur_pos + count > stream_impl->lpECB->cbAvailable
+            && stream_impl->cur_pos < stream_impl->lpECB->cbAvailable)
         {
             int read_length = 0;
-            if (count + stream_impl->cur_pos <= stream_impl->lpECB->cbAvailable)
-                read_length = (unsigned) count;
+            if(count + stream_impl->cur_pos <= stream_impl->lpECB->cbAvailable)
+                read_length = (unsigned)count;
             else
-                read_length = 
-                    stream_impl->lpECB->cbTotalBytes - stream_impl->cur_pos;
-            data_to_read =
-                stream_impl->lpECB->cbAvailable - stream_impl->cur_pos;
+                read_length = stream_impl->lpECB->cbTotalBytes - stream_impl->cur_pos;
+            data_to_read = stream_impl->lpECB->cbAvailable - stream_impl->cur_pos;
             memcpy(buffer, stream_impl->cur_position, data_to_read);
-            
-            read_bytes =
-                stream_impl->cur_pos + read_length - stream_impl->lpECB->cbAvailable;
+
+            read_bytes = stream_impl->cur_pos + read_length - stream_impl->lpECB->cbAvailable;
             temp_buff = malloc(read_bytes);
 
-            if (temp_buff == NULL)
+            if(temp_buff == NULL)
                 return data_to_read;
-            ret_val =
-                stream_impl->lpECB->ReadClient(stream_impl->lpECB->ConnID,
-                                               temp_buff, &read_bytes);
-            memcpy(((char *) buffer + data_to_read), temp_buff, read_bytes);
+            ret_val = stream_impl->lpECB->ReadClient(stream_impl->lpECB->ConnID, temp_buff,
+                &read_bytes);
+            memcpy(((char *)buffer + data_to_read), temp_buff, read_bytes);
             read_bytes += data_to_read;
             temp = (char *)(stream_impl->cur_position);
             temp += read_bytes;
             stream_impl->cur_position = temp;
-            stream_impl->cur_pos += (unsigned) read_bytes;
+            stream_impl->cur_pos += (unsigned)read_bytes;
         }
         else
         {
@@ -181,11 +170,11 @@
             temp += count;
             stream_impl->cur_position = temp;
             temp = NULL;
-            stream_impl->cur_pos += (unsigned) count;
-            read_bytes = (int) count;
+            stream_impl->cur_pos += (unsigned)count;
+            read_bytes = (int)count;
         }
     }
-    if (ret_val == TRUE)
+    if(ret_val == TRUE)
         return read_bytes;
     else
         return -1;
@@ -206,18 +195,17 @@
     AXIS2_ENV_CHECK(env, AXIS2_CRITICAL_FAILURE);
     AXIS2_PARAM_CHECK(env->error, buf, AXIS2_FAILURE);
     stream_impl = AXIS2_INTF_TO_IMPL(stream);
-    buffer = (axis2_char_t *) buf;
-    bytes_sent = (unsigned) strlen(buffer);
-    
-    if (count <= 0)
+    buffer = (axis2_char_t *)buf;
+    bytes_sent = (unsigned)strlen(buffer);
+
+    if(count <= 0)
     {
-        return (int) count;
+        return (int)count;
     }
     /* assume that buffer is not null terminated */
-    ret_val =
-        stream_impl->lpECB->WriteClient(stream_impl->lpECB->ConnID, buffer,
-                                        &bytes_sent, HSE_IO_SYNC);
-    if (ret_val == TRUE)
+    ret_val = stream_impl->lpECB->WriteClient(stream_impl->lpECB->ConnID, buffer, &bytes_sent,
+        HSE_IO_SYNC);
+    if(ret_val == TRUE)
         return (int)bytes_sent;
     else
         return -1;
@@ -233,22 +221,21 @@
     iis_stream_impl_t *stream_impl = NULL;
     void *temp_buff = NULL;
     int data_to_read = 0;
-    DWORD read_bytes = (DWORD) count;
+    DWORD read_bytes = (DWORD)count;
     char *temp = NULL;
 
     AXIS2_ENV_CHECK(env, AXIS2_CRITICAL_FAILURE);
-    stream_impl = (iis_stream_impl_t *) stream;
+    stream_impl = (iis_stream_impl_t *)stream;
 
-    if (stream_impl->cur_pos == 0)
+    if(stream_impl->cur_pos == 0)
         stream_impl->cur_position = stream_impl->lpECB->lpbData;
 
-    if (stream_impl->lpECB->cbAvailable == stream_impl->lpECB->cbTotalBytes)
+    if(stream_impl->lpECB->cbAvailable == stream_impl->lpECB->cbTotalBytes)
     {
-        if (count + stream_impl->cur_pos <= stream_impl->lpECB->cbAvailable)
+        if(count + stream_impl->cur_pos <= stream_impl->lpECB->cbAvailable)
             data_to_read = count;
         else
-            data_to_read =
-                stream_impl->lpECB->cbAvailable - stream_impl->cur_pos;
+            data_to_read = stream_impl->lpECB->cbAvailable - stream_impl->cur_pos;
 
         temp = (char *)(stream_impl->cur_position);
         temp += data_to_read;
@@ -257,39 +244,34 @@
         stream_impl->cur_pos += data_to_read;
         read_bytes = data_to_read;
     }
-    else if (stream_impl->lpECB->cbAvailable == -1)
+    else if(stream_impl->lpECB->cbAvailable == -1)
     {
         temp_buff = malloc(read_bytes);
-        ret_val =
-            stream_impl->lpECB->ReadClient(stream_impl->lpECB->ConnID,
-                                           temp_buff, &read_bytes);
+        ret_val
+            = stream_impl->lpECB->ReadClient(stream_impl->lpECB->ConnID, temp_buff, &read_bytes);
         free(temp_buff);
     }
-    else if (stream_impl->lpECB->cbAvailable < stream_impl->lpECB->cbTotalBytes)
+    else if(stream_impl->lpECB->cbAvailable < stream_impl->lpECB->cbTotalBytes)
     {
-        if (stream_impl->cur_pos > stream_impl->lpECB->cbAvailable)
+        if(stream_impl->cur_pos > stream_impl->lpECB->cbAvailable)
         {
             temp_buff = malloc(read_bytes);
-            ret_val =
-                stream_impl->lpECB->ReadClient(stream_impl->lpECB->ConnID,
-                                               temp_buff, &read_bytes);
+            ret_val = stream_impl->lpECB->ReadClient(stream_impl->lpECB->ConnID, temp_buff,
+                &read_bytes);
             free(temp_buff);
         }
-        else if (stream_impl->cur_pos + count > stream_impl->lpECB->cbAvailable
-                 && stream_impl->cur_pos < stream_impl->lpECB->cbAvailable)
+        else if(stream_impl->cur_pos + count > stream_impl->lpECB->cbAvailable
+            && stream_impl->cur_pos < stream_impl->lpECB->cbAvailable)
         {
-            data_to_read =
-                stream_impl->lpECB->cbAvailable - stream_impl->cur_pos;
-            read_bytes =
-                stream_impl->cur_pos + count - stream_impl->lpECB->cbAvailable;
+            data_to_read = stream_impl->lpECB->cbAvailable - stream_impl->cur_pos;
+            read_bytes = stream_impl->cur_pos + count - stream_impl->lpECB->cbAvailable;
             temp_buff = malloc(read_bytes);
 
-            if (temp_buff == NULL)
+            if(temp_buff == NULL)
                 return data_to_read;
 
-            ret_val =
-                stream_impl->lpECB->ReadClient(stream_impl->lpECB->ConnID,
-                                               temp_buff, &read_bytes);
+            ret_val = stream_impl->lpECB->ReadClient(stream_impl->lpECB->ConnID, temp_buff,
+                &read_bytes);
             read_bytes += data_to_read;
             free(temp_buff);
         }
@@ -303,7 +285,7 @@
             read_bytes = count;
         }
     }
-    if (ret_val == FALSE)
+    if(ret_val == FALSE)
     {
         return -1;
     }

Modified: webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_worker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_worker.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_worker.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_worker.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
@@ -14,7 +13,7 @@
  * 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_http_transport.h>
 #include <axis2_conf.h>
@@ -40,78 +39,80 @@
 
 #define READ_SIZE  2048
 
-axis2_status_t AXIS2_CALL 
-axis2_worker_get_original_url(char url[],
-                              char ret_url[]);
-
-
-axis2_char_t * AXIS2_CALL 
-axis2_iis_worker_get_bytes(const axutil_env_t * env,
-                           axutil_stream_t * stream);
-
-
-axis2_status_t AXIS2_CALL 
-start_response(const axutil_env_t * env, 
-			   LPEXTENSION_CONTROL_BLOCK lpECB,
-               int status, 
-               const char *reason,
-               axutil_array_list_t *headers
-               );
-
+axis2_status_t AXIS2_CALL
+axis2_worker_get_original_url(
+    char url[],
+    char ret_url[]);
 
-axis2_status_t 
-write_response(LPEXTENSION_CONTROL_BLOCK lpECB, 
-               const void *b,
-               unsigned int l);
+axis2_char_t * AXIS2_CALL
+axis2_iis_worker_get_bytes(
+    const axutil_env_t * env,
+    axutil_stream_t * stream);
 
-axutil_hash_t *axis2_iis_worker_read_http_headers(const axutil_env_t * env, LPEXTENSION_CONTROL_BLOCK lpECB);
+axis2_status_t AXIS2_CALL
+start_response(
+    const axutil_env_t * env,
+    LPEXTENSION_CONTROL_BLOCK lpECB,
+    int status,
+    const char *reason,
+    axutil_array_list_t *headers);
+
+axis2_status_t
+write_response(
+    LPEXTENSION_CONTROL_BLOCK lpECB,
+    const void *b,
+    unsigned int l);
+
+axutil_hash_t *
+axis2_iis_worker_read_http_headers(
+    const axutil_env_t * env,
+    LPEXTENSION_CONTROL_BLOCK lpECB);
 
 AXIS2_IMPORT extern axis2_char_t *axis2_request_url_prefix;
 
 static struct reasons
-{    
+{
     axis2_char_t * status_code;
     int status_len;
-} reasons[] = {
-    {"200 OK", 6}, 
-    {"202 Accepted", 12}, 
-    {"500 Internal Server Error", 25} 
-};
+} reasons[] = { { "200 OK", 6 }, { "202 Accepted", 12 }, { "500 Internal Server Error", 25 } };
 
-struct axis2_iis_worker 
+struct axis2_iis_worker
 {
     axis2_conf_ctx_t * conf_ctx;
 };
 
-char *status_reason(int status);
-
-axis2_iis_worker_t * AXIS2_CALL 
-axis2_iis_worker_create(const axutil_env_t * env,
-                        axis2_char_t * repo_path) 
+char *
+status_reason(
+    int status);
+
+axis2_iis_worker_t * AXIS2_CALL
+axis2_iis_worker_create(
+    const axutil_env_t * env,
+    axis2_char_t * repo_path)
 {
     axis2_iis_worker_t * iis_worker = NULL;
 
-    iis_worker = (axis2_iis_worker_t *) AXIS2_MALLOC(env->allocator, sizeof(axis2_iis_worker_t));
-    if (!iis_worker)
+    iis_worker = (axis2_iis_worker_t *)AXIS2_MALLOC(env->allocator, sizeof(axis2_iis_worker_t));
+    if(!iis_worker)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
     iis_worker->conf_ctx = axis2_build_conf_ctx(env, repo_path);
-    if (!iis_worker->conf_ctx)
-    {        
-        axis2_iis_worker_free((axis2_iis_worker_t *) iis_worker, env);
+    if(!iis_worker->conf_ctx)
+    {
+        axis2_iis_worker_free((axis2_iis_worker_t *)iis_worker, env);
         return NULL;
     }
     return iis_worker;
 }
 
-
-void AXIS2_CALL 
-axis2_iis_worker_free(axis2_iis_worker_t * iis_worker,
-                      const axutil_env_t * env) 
+void AXIS2_CALL
+axis2_iis_worker_free(
+    axis2_iis_worker_t * iis_worker,
+    const axutil_env_t * env)
 {
-    if (iis_worker->conf_ctx)
+    if(iis_worker->conf_ctx)
     {
         axis2_conf_ctx_free(iis_worker->conf_ctx, env);
         iis_worker->conf_ctx = NULL;
@@ -120,267 +121,271 @@
     return;
 }
 
-
-int AXIS2_CALL 
-axis2_iis_worker_process_request(axis2_iis_worker_t * iis_worker,
-                                 const axutil_env_t * env,
-                                 LPEXTENSION_CONTROL_BLOCK lpECB) 
+int AXIS2_CALL
+axis2_iis_worker_process_request(
+    axis2_iis_worker_t * iis_worker,
+    const axutil_env_t * env,
+    LPEXTENSION_CONTROL_BLOCK lpECB)
 {
     axis2_conf_ctx_t * conf_ctx = NULL;
     axutil_stream_t * out_stream = NULL;
     axis2_transport_out_desc_t * out_desc = NULL;
     axis2_transport_in_desc_t * in_desc = NULL;
-    axis2_char_t soap_action[INTERNET_MAX_URL_LENGTH];    
+    axis2_char_t soap_action[INTERNET_MAX_URL_LENGTH];
     axis2_char_t original_url[INTERNET_MAX_URL_LENGTH];
     axis2_char_t req_url[INTERNET_MAX_URL_LENGTH];
     DWORD cbSize = 0;
     CHAR server_name[MAX_SERVERNAME];
     axis2_char_t port[MAX_TCP_PORT_LEN];
     axis2_char_t redirect_url[INTERNET_MAX_PATH_LENGTH];
-	axis2_char_t accept_language[INTERNET_MAX_PATH_LENGTH];
+    axis2_char_t accept_language[INTERNET_MAX_PATH_LENGTH];
     axutil_hash_t *headers = NULL;
     axis2_char_t peer_ip[50];
-	axis2_char_t accept_header[INTERNET_MAX_URL_LENGTH];
-	axis2_char_t accept_charset[INTERNET_MAX_URL_LENGTH];
+    axis2_char_t accept_header[INTERNET_MAX_URL_LENGTH];
+    axis2_char_t accept_charset[INTERNET_MAX_URL_LENGTH];
     /*axutil_property_t *peer_property = NULL;*/
-	
-	axis2_http_header_t *content_type_header = NULL;
-	axis2_http_header_t *content_length_header = NULL;
-
-	/* New Code variables */
-	axis2_http_transport_in_t request;
-	axis2_http_transport_out_t response;
 
-	/* initialize tranport in structure */
-	axis2_http_transport_utils_transport_in_init(&request, env);
+    axis2_http_header_t *content_type_header = NULL;
+    axis2_http_header_t *content_length_header = NULL;
+
+    /* New Code variables */
+    axis2_http_transport_in_t request;
+    axis2_http_transport_out_t response;
+
+    /* initialize tranport in structure */
+    axis2_http_transport_utils_transport_in_init(&request, env);
 
-	/* initialize tranport out structure */
-	axis2_http_transport_utils_transport_out_init(&response, env);
+    /* initialize tranport out structure */
+    axis2_http_transport_utils_transport_out_init(&response, env);
 
     soap_action[0] = '\0';
-    
+
     /*Check the parameters*/
-    if (!lpECB)
+    if(!lpECB)
     {
         AXIS2_ERROR_SET_ERROR_NUMBER(env->error, AXIS2_ERROR_INVALID_NULL_PARAM);
         return AXIS2_FAILURE;
     }
     conf_ctx = iis_worker->conf_ctx;
-    if (!conf_ctx)
+    if(!conf_ctx)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_CONFIGURATION_CONTEXT, AXIS2_FAILURE);
         return AXIS2_FAILURE;
     }
 
     cbSize = INTERNET_MAX_PATH_LENGTH;
-    if (lpECB->GetServerVariable(lpECB->ConnID,  "SERVER_NAME",  server_name, &cbSize) == FALSE)
-	{
-		AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot get server name from IIS.");        
-		return AXIS2_FAILURE;
-	}
+    if(lpECB->GetServerVariable(lpECB->ConnID, "SERVER_NAME", server_name, &cbSize) == FALSE)
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot get server name from IIS.");
+        return AXIS2_FAILURE;
+    }
     cbSize = MAX_TCP_PORT_LEN;
-	if (lpECB->GetServerVariable(lpECB->ConnID, "SERVER_PORT", port, &cbSize) == FALSE)
-	{
-		AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot get server port from IIS.");        
-		return AXIS2_FAILURE;
-	}
+    if(lpECB->GetServerVariable(lpECB->ConnID, "SERVER_PORT", port, &cbSize) == FALSE)
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot get server port from IIS.");
+        return AXIS2_FAILURE;
+    }
     request.svr_port = port;
 
     cbSize = INTERNET_MAX_PATH_LENGTH;
     if(lpECB->GetServerVariable(lpECB->ConnID, "HTTP_URL", redirect_url, &cbSize) == FALSE)
-	{
-		AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot get server port from IIS.");        
-		return AXIS2_FAILURE;
-	}
-
-	/* We have a mapped URL only when the server version is 5 or less than that. */
-	if (server_version <= 5)
-	{
-		axis2_worker_get_original_url(redirect_url, original_url);
-		/* create the url using the above variables */                     
-		sprintf(req_url, "%s%s%s%s%s", "http://", server_name, ":", port, original_url);
-	}
-	else
-	{
-		sprintf(req_url, "%s%s%s%s%s", "http://", server_name, ":", port, redirect_url);
-	}
-	/* Set the request url */
-	request.request_uri = req_url;
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Cannot get server port from IIS.");
+        return AXIS2_FAILURE;
+    }
+
+    /* We have a mapped URL only when the server version is 5 or less than that. */
+    if(server_version <= 5)
+    {
+        axis2_worker_get_original_url(redirect_url, original_url);
+        /* create the url using the above variables */
+        sprintf(req_url, "%s%s%s%s%s", "http://", server_name, ":", port, original_url);
+    }
+    else
+    {
+        sprintf(req_url, "%s%s%s%s%s", "http://", server_name, ":", port, redirect_url);
+    }
+    /* Set the request url */
+    request.request_uri = req_url;
 
     out_stream = axutil_stream_create_basic(env);
-    out_desc = axis2_conf_get_transport_out(
-        axis2_conf_ctx_get_conf (iis_worker->conf_ctx, env), env, AXIS2_TRANSPORT_ENUM_HTTP);
-    in_desc = axis2_conf_get_transport_in(
-        axis2_conf_ctx_get_conf (iis_worker->conf_ctx, env), env, AXIS2_TRANSPORT_ENUM_HTTP);
+    out_desc = axis2_conf_get_transport_out(axis2_conf_ctx_get_conf(iis_worker->conf_ctx, env),
+        env, AXIS2_TRANSPORT_ENUM_HTTP);
+    in_desc = axis2_conf_get_transport_in(axis2_conf_ctx_get_conf(iis_worker->conf_ctx, env), env,
+        AXIS2_TRANSPORT_ENUM_HTTP);
 
-	/* Create the in message context */
+    /* Create the in message context */
     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);
-    
-	/* Get the SOAPAction Header */
-	cbSize = INTERNET_MAX_URL_LENGTH;
-    if (lpECB->GetServerVariable(lpECB->ConnID, "HTTP_SOAPAction", soap_action, &cbSize))
-    {		
-		request.soap_action = soap_action;
+
+    /* Get the SOAPAction Header */
+    cbSize = INTERNET_MAX_URL_LENGTH;
+    if(lpECB->GetServerVariable(lpECB->ConnID, "HTTP_SOAPAction", soap_action, &cbSize))
+    {
+        request.soap_action = soap_action;
     }
 
-	/* Create the in stream */
+    /* Create the in stream */
     request.in_stream = axutil_stream_create_iis(env, lpECB);
-    if (!request.in_stream)
+    if(!request.in_stream)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Error occured in creating input stream.");
         return AXIS2_FAILURE;
     }
 
-	/* Get the Remote Adrress */
-    if (lpECB->GetServerVariable(lpECB->ConnID, "REMOTE_ADDR", peer_ip, &cbSize))
-	{
-		request.remote_ip = peer_ip;
-	}    
+    /* Get the Remote Adrress */
+    if(lpECB->GetServerVariable(lpECB->ConnID, "REMOTE_ADDR", peer_ip, &cbSize))
+    {
+        request.remote_ip = peer_ip;
+    }
 
     /* Set the http headers into the message context */
     headers = axis2_iis_worker_read_http_headers(env, lpECB);
-    if (axis2_msg_ctx_set_transport_headers(request.msg_ctx, env, headers) == AXIS2_FAILURE)
+    if(axis2_msg_ctx_set_transport_headers(request.msg_ctx, env, headers) == AXIS2_FAILURE)
     {
         AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "IIS: Error occured in setting transport headers.");
     }
-	/* Set the content length */
-	request.content_length = lpECB->cbTotalBytes;
-	/* Set the HTTP method */
-	if (axutil_strcasecmp(lpECB->lpszMethod, "POST") == 0)
-	{
-		request.request_method = AXIS2_HTTP_METHOD_POST;
-	}
-	else if (axutil_strcasecmp(lpECB->lpszMethod, "GET") == 0)
-	{
-		request.request_method = AXIS2_HTTP_METHOD_GET;
-	}
-	else if (axutil_strcasecmp(lpECB->lpszMethod, "HEAD") == 0)
-	{
-		request.request_method = AXIS2_HTTP_METHOD_HEAD;
-	}
-	else if (axutil_strcasecmp(lpECB->lpszMethod, "PUT") == 0)
-	{
-		request.request_method = AXIS2_HTTP_METHOD_PUT;
-	}
-	else if (axutil_strcasecmp(lpECB->lpszMethod, "DELETE") == 0)
-	{
-		request.request_method = AXIS2_HTTP_METHOD_DELETE;
-	}
-	else
-	{
-		AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "IIS: Unsupported HTTP Method.");
-		return AXIS2_FAILURE;
-	}
-	/* Set the URL prefix. axis2_request_url_prefix is a global variable set at the init time */
-	request.request_url_prefix = axis2_request_url_prefix;
-	/* Create the transport out info */
-	request.out_transport_info = axis2_iis_out_transport_info_create(env, lpECB);
-	/* Set the content type */
-	request.content_type = lpECB->lpszContentType;
-	
-	/* Get accept headaer */
-	cbSize = INTERNET_MAX_PATH_LENGTH;
+    /* Set the content length */
+    request.content_length = lpECB->cbTotalBytes;
+    /* Set the HTTP method */
+    if(axutil_strcasecmp(lpECB->lpszMethod, "POST") == 0)
+    {
+        request.request_method = AXIS2_HTTP_METHOD_POST;
+    }
+    else if(axutil_strcasecmp(lpECB->lpszMethod, "GET") == 0)
+    {
+        request.request_method = AXIS2_HTTP_METHOD_GET;
+    }
+    else if(axutil_strcasecmp(lpECB->lpszMethod, "HEAD") == 0)
+    {
+        request.request_method = AXIS2_HTTP_METHOD_HEAD;
+    }
+    else if(axutil_strcasecmp(lpECB->lpszMethod, "PUT") == 0)
+    {
+        request.request_method = AXIS2_HTTP_METHOD_PUT;
+    }
+    else if(axutil_strcasecmp(lpECB->lpszMethod, "DELETE") == 0)
+    {
+        request.request_method = AXIS2_HTTP_METHOD_DELETE;
+    }
+    else
+    {
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "IIS: Unsupported HTTP Method.");
+        return AXIS2_FAILURE;
+    }
+    /* Set the URL prefix. axis2_request_url_prefix is a global variable set at the init time */
+    request.request_url_prefix = axis2_request_url_prefix;
+    /* Create the transport out info */
+    request.out_transport_info = axis2_iis_out_transport_info_create(env, lpECB);
+    /* Set the content type */
+    request.content_type = lpECB->lpszContentType;
+
+    /* Get accept headaer */
+    cbSize = INTERNET_MAX_PATH_LENGTH;
     if(lpECB->GetServerVariable(lpECB->ConnID, "HTTP_Accept", accept_header, &cbSize))
-	{
-		request.accept_header = accept_header;
-	}	
-	
-	/* Get the accept langauge */
-	cbSize = INTERNET_MAX_PATH_LENGTH;
-    if (lpECB->GetServerVariable(lpECB->ConnID, "HTTP_Accept-Language", accept_language, &cbSize))
-	{
-		request.accept_language_header = accept_language;
-	}	
-	
-	cbSize = INTERNET_MAX_PATH_LENGTH;
-    if (lpECB->GetServerVariable(lpECB->ConnID, "HTTP_Accept-Charset", accept_charset, &cbSize))
-	{
-		request.accept_charset_header = accept_charset;
-	}
-
-	/* Now we have set everything. We can call process method to process the request */
-	if (axis2_http_transport_utils_process_request(env, conf_ctx, &request, &response) == AXIS2_FAILURE)
-	{
-		return AXIS2_FAILURE;
-	}
-		
-	/* Write the response */
-	if (response.response_data && response.response_data_length > 0)
-	{	
-		axis2_char_t content_length_str[16]={0}; 
-		axis2_bool_t is_out_headers_created = AXIS2_FALSE;
-		if (!response.output_headers)
-		{
-			response.output_headers = axutil_array_list_create(env, 2);
-			is_out_headers_created = AXIS2_TRUE;
-		}
-		sprintf(content_length_str, "%d", response.response_data_length);
-		if (!response.content_type)
-		{
-			content_type_header = axis2_http_header_create(env, "Content-Type", axis2_iis_out_transport_get_content(request.out_transport_info));
-		}
-		else
-		{
-			content_type_header = axis2_http_header_create(env, "Content-Type", response.content_type);
-		}
-		content_length_header = axis2_http_header_create(env, "Content-Length", content_length_str);
-		axutil_array_list_add(response.output_headers, env, content_length_header);
-		axutil_array_list_add(response.output_headers, env, content_type_header);
-		/* Write the headers */
-		start_response(env, lpECB, response.http_status_code, response.http_status_code_name, response.output_headers);
-		/* Write the response body */
-		if(write_response(lpECB, response.response_data, response.response_data_length) == AXIS2_FAILURE)
-		{
-			AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "IIS: Writing data to IIS");
-			return AXIS2_FAILURE;
-		}
-		if (is_out_headers_created)
-		{
-			if (content_length_header)
-			{
-				axis2_http_header_free(content_length_header, env);
-			}
-			if (content_type_header)
-			{
-				axis2_http_header_free(content_type_header, env);
-			}
-			axutil_array_list_free(response.output_headers, env);
-		}
-	}
-	else
-	{
-		/* If we don't have a body we should write the HTTP headers */
-		start_response(env, lpECB, response.http_status_code, response.http_status_code_name, response.output_headers);
-		AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Response is NULL");
-	}
-	
-	/* Do some cleaning */
-	axis2_http_transport_utils_transport_in_uninit(&request, env);
-	axis2_http_transport_utils_transport_out_uninit(&response, env);
-	return AXIS2_SUCCESS;
-}
+    {
+        request.accept_header = accept_header;
+    }
 
+    /* Get the accept langauge */
+    cbSize = INTERNET_MAX_PATH_LENGTH;
+    if(lpECB->GetServerVariable(lpECB->ConnID, "HTTP_Accept-Language", accept_language, &cbSize))
+    {
+        request.accept_language_header = accept_language;
+    }
 
+    cbSize = INTERNET_MAX_PATH_LENGTH;
+    if(lpECB->GetServerVariable(lpECB->ConnID, "HTTP_Accept-Charset", accept_charset, &cbSize))
+    {
+        request.accept_charset_header = accept_charset;
+    }
 
-axis2_status_t write_response(LPEXTENSION_CONTROL_BLOCK lpECB, const void *b,
-                              unsigned int l) 
+    /* Now we have set everything. We can call process method to process the request */
+    if(axis2_http_transport_utils_process_request(env, conf_ctx, &request, &response)
+        == AXIS2_FAILURE)
+    {
+        return AXIS2_FAILURE;
+    }
+
+    /* Write the response */
+    if(response.response_data && response.response_data_length > 0)
+    {
+        axis2_char_t content_length_str[16] = { 0 };
+        axis2_bool_t is_out_headers_created = AXIS2_FALSE;
+        if(!response.output_headers)
+        {
+            response.output_headers = axutil_array_list_create(env, 2);
+            is_out_headers_created = AXIS2_TRUE;
+        }
+        sprintf(content_length_str, "%d", response.response_data_length);
+        if(!response.content_type)
+        {
+            content_type_header = axis2_http_header_create(env, "Content-Type",
+                axis2_iis_out_transport_get_content(request.out_transport_info));
+        }
+        else
+        {
+            content_type_header = axis2_http_header_create(env, "Content-Type",
+                response.content_type);
+        }
+        content_length_header = axis2_http_header_create(env, "Content-Length", content_length_str);
+        axutil_array_list_add(response.output_headers, env, content_length_header);
+        axutil_array_list_add(response.output_headers, env, content_type_header);
+        /* Write the headers */
+        start_response(env, lpECB, response.http_status_code, response.http_status_code_name,
+            response.output_headers);
+        /* Write the response body */
+        if(write_response(lpECB, response.response_data, response.response_data_length)
+            == AXIS2_FAILURE)
+        {
+            AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "IIS: Writing data to IIS");
+            return AXIS2_FAILURE;
+        }
+        if(is_out_headers_created)
+        {
+            if(content_length_header)
+            {
+                axis2_http_header_free(content_length_header, env);
+            }
+            if(content_type_header)
+            {
+                axis2_http_header_free(content_type_header, env);
+            }
+            axutil_array_list_free(response.output_headers, env);
+        }
+    }
+    else
+    {
+        /* If we don't have a body we should write the HTTP headers */
+        start_response(env, lpECB, response.http_status_code, response.http_status_code_name,
+            response.output_headers);
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Response is NULL");
+    }
+
+    /* Do some cleaning */
+    axis2_http_transport_utils_transport_in_uninit(&request, env);
+    axis2_http_transport_utils_transport_out_uninit(&response, env);
+    return AXIS2_SUCCESS;
+}
+
+axis2_status_t
+write_response(
+    LPEXTENSION_CONTROL_BLOCK lpECB,
+    const void *b,
+    unsigned int l)
 {
-    if (lpECB && b)
+    if(lpECB && b)
     {
-        if (l)
+        if(l)
         {
             unsigned int written = 0;
-            char *buf = (char *) b;
+            char *buf = (char *)b;
             /* If couldn't write the data at onece try again until all the data is written.*/
-            while (written < l)
+            while(written < l)
             {
                 DWORD try_to_write = l - written;
-                if (!lpECB->
-                    WriteClient(lpECB->ConnID, 
-                    buf + written, &try_to_write,
-                    0))
+                if(!lpECB-> WriteClient(lpECB->ConnID, buf + written, &try_to_write, 0))
                 {
                     return AXIS2_FAILURE;
                 }
@@ -392,79 +397,78 @@
     return AXIS2_FAILURE;
 }
 
-
-
-axis2_status_t AXIS2_CALL start_response(const axutil_env_t *env, 
-										 LPEXTENSION_CONTROL_BLOCK lpECB,
-                                         int status, 
-                                         const char *reason,
-                                         axutil_array_list_t *headers
-                                         ) 
+axis2_status_t AXIS2_CALL
+start_response(
+    const axutil_env_t *env,
+    LPEXTENSION_CONTROL_BLOCK lpECB,
+    int status,
+    const char *reason,
+    axutil_array_list_t *headers)
 {
-    static char crlf[3] = { (char) 13, (char) 10, '\0' };
-	unsigned int num_of_headers = 0;
+    static char crlf[3] = { (char)13, (char)10, '\0' };
+    unsigned int num_of_headers = 0;
 
-    if (status < 100 || status > 1000)
+    if(status < 100 || status > 1000)
     {
         return AXIS2_FAILURE;
     }
-    if (lpECB)
+    if(lpECB)
     {
         size_t len_of_status;
         char *status_str;
         char *headers_str;
 
         /*
-        * Create the status line
-        */ 
-        if (reason)
+         * Create the status line
+         */
+        if(reason)
         {
-            status_str = (char *) _alloca((6 + strlen(reason)) * sizeof(char));
+            status_str = (char *)_alloca((6 + strlen(reason)) * sizeof(char));
             sprintf(status_str, "%d %s", status, reason);
             len_of_status = strlen(status_str);
         }
         else
         {
-            switch (status)
+            switch(status)
             {
-            case 200:
-                status_str = reasons[0].status_code;
-                len_of_status = reasons[0].status_len;
-                break;
-            case 202:
-                status_str = reasons[1].status_code;
-                len_of_status = reasons[1].status_len;
-                break;
-            case 500:
-                status_str = reasons[2].status_code;
-                len_of_status = reasons[2].status_len;
-                break;
-            default:
-                status_str = reasons[0].status_code;
-                len_of_status = reasons[0].status_len;
-                break;
+                case 200:
+                    status_str = reasons[0].status_code;
+                    len_of_status = reasons[0].status_len;
+                    break;
+                case 202:
+                    status_str = reasons[1].status_code;
+                    len_of_status = reasons[1].status_len;
+                    break;
+                case 500:
+                    status_str = reasons[2].status_code;
+                    len_of_status = reasons[2].status_len;
+                    break;
+                default:
+                    status_str = reasons[0].status_code;
+                    len_of_status = reasons[0].status_len;
+                    break;
             }
         }
         /*
-        * Create response headers string
-        */ 
-        if (headers && (num_of_headers = axutil_array_list_size(headers, env)) > 0)
+         * Create response headers string
+         */
+        if(headers && (num_of_headers = axutil_array_list_size(headers, env)) > 0)
         {
             size_t i, len_of_headers;
-			axis2_http_header_t *header = NULL;
-            for (i = 0, len_of_headers = 0; i < num_of_headers; i++)
+            axis2_http_header_t *header = NULL;
+            for(i = 0, len_of_headers = 0; i < num_of_headers; i++)
             {
-				header = axutil_array_list_get(headers, env, (int)i);
+                header = axutil_array_list_get(headers, env, (int)i);
                 len_of_headers += strlen(axis2_http_header_get_name(header, env));
                 len_of_headers += strlen(axis2_http_header_get_value(header, env));
-                len_of_headers += 4;   /* extra for colon, space and crlf */
+                len_of_headers += 4; /* extra for colon, space and crlf */
             }
-            len_of_headers += 3;  /* crlf and terminating null char */
-            headers_str = (char *) _alloca(len_of_headers * sizeof(char));
+            len_of_headers += 3; /* crlf and terminating null char */
+            headers_str = (char *)_alloca(len_of_headers * sizeof(char));
             headers_str[0] = '\0';
-            for (i = 0; i < num_of_headers; i++)
+            for(i = 0; i < num_of_headers; i++)
             {
-				header = axutil_array_list_get(headers, env, (int)i);
+                header = axutil_array_list_get(headers, env, (int)i);
                 strcat(headers_str, axis2_http_header_get_name(header, env));
                 strcat(headers_str, ": ");
                 strcat(headers_str, axis2_http_header_get_value(header, env));
@@ -476,12 +480,8 @@
         {
             headers_str = crlf;
         }
-        if (!lpECB->
-            ServerSupportFunction(lpECB->ConnID,
-            HSE_REQ_SEND_RESPONSE_HEADER, 
-            status_str,
-            (LPDWORD) & len_of_status,
-            (LPDWORD) headers_str))
+        if(!lpECB-> ServerSupportFunction(lpECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER, status_str,
+            (LPDWORD) & len_of_status, (LPDWORD)headers_str))
         {
             return AXIS2_FAILURE;
         }
@@ -490,19 +490,21 @@
     return AXIS2_FAILURE;
 }
 
-axis2_status_t AXIS2_CALL axis2_worker_get_original_url(char url[],
-                                                        char ret_url[]) 
+axis2_status_t AXIS2_CALL
+axis2_worker_get_original_url(
+    char url[],
+    char ret_url[])
 {
-	extern axis2_char_t *axis2_location;
-	strcpy(ret_url, axis2_location);
-	strcat(ret_url, &url[25]);
+    extern axis2_char_t *axis2_location;
+    strcpy(ret_url, axis2_location);
+    strcat(ret_url, &url[25]);
     return URI_MATCHED;
 }
 
-axis2_char_t * AXIS2_CALL 
+axis2_char_t * AXIS2_CALL
 axis2_iis_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;
     int return_size = -1;
@@ -512,31 +514,28 @@
     AXIS2_PARAM_CHECK(env->error, stream, NULL);
 
     tmp_stream = axutil_stream_create_basic(env);
-    while (loop_state)
+    while(loop_state)
     {
         int read = 0;
         int write = 0;
         char buf[READ_SIZE];
 
         read = axutil_stream_read(stream, env, buf, READ_SIZE);
-        if (read < 0)
+        if(read < 0)
         {
             break;
         }
         write = axutil_stream_write(tmp_stream, env, buf, read);
-        if (read < (READ_SIZE - 1))
+        if(read < (READ_SIZE - 1))
         {
             break;
         }
     }
     return_size = axutil_stream_get_len(tmp_stream, env);
-    if (return_size > 0)
+    if(return_size > 0)
     {
-        buffer = (char *) AXIS2_MALLOC(env->allocator, sizeof(char) * 
-            (return_size + 2));
-        return_size =
-            axutil_stream_read(tmp_stream, env, buffer, 
-            return_size + 1);
+        buffer = (char *)AXIS2_MALLOC(env->allocator, sizeof(char) * (return_size + 2));
+        return_size = axutil_stream_read(tmp_stream, env, buffer, return_size + 1);
         buffer[return_size + 1] = '\0';
     }
     axutil_stream_free(tmp_stream, env);
@@ -544,9 +543,11 @@
 }
 
 /** Read all HTTP headers.
-  */
-axutil_hash_t *axis2_iis_worker_read_http_headers(const axutil_env_t * env, 
-												  LPEXTENSION_CONTROL_BLOCK lpECB)
+ */
+axutil_hash_t *
+axis2_iis_worker_read_http_headers(
+    const axutil_env_t * env,
+    LPEXTENSION_CONTROL_BLOCK lpECB)
 {
     const char szHTTP_[] = "HTTP_";
     char szBuffer[4096];
@@ -554,8 +555,8 @@
     axutil_hash_t *headers = NULL;
     axis2_http_header_t* http_header = NULL;
 
-    BOOL bGet = lpECB->GetServerVariable(lpECB->ConnID, "ALL_HTTP", szBuffer, &dwBufferSize);    
-    if (bGet)
+    BOOL bGet = lpECB->GetServerVariable(lpECB->ConnID, "ALL_HTTP", szBuffer, &dwBufferSize);
+    if(bGet)
     {
         /* Find lines, split key/data pair and write them as output */
         LPTSTR pOpts = NULL;
@@ -566,38 +567,40 @@
 
         headers = axutil_hash_make(env);
         szTmpBuf[0] = 0;
-        for (pChar = szBuffer; '\0' != *pChar;)
+        for(pChar = szBuffer; '\0' != *pChar;)
         {
-            if (*pChar == '\r' || *pChar == '\n')
+            if(*pChar == '\r' || *pChar == '\n')
             {
                 pChar++;
                 continue;
             }
             pOpts = strchr(pChar, ':');/* findseparator */
-            if (pOpts && *pOpts)
+            if(pOpts && *pOpts)
             {
                 pEnd = pOpts;
-                while (*pEnd && *pEnd != '\r' && *pEnd != '\n')
+                while(*pEnd && *pEnd != '\r' && *pEnd != '\n')
                 {
                     pEnd++;
                 }
                 *pOpts = '\0'; /* split the strings */
                 *pEnd = '\0';
-                if (0 == strncmp(pChar, szHTTP_, strlen(szHTTP_)))
+                if(0 == strncmp(pChar, szHTTP_, strlen(szHTTP_)))
                 {
-                  pChar += strlen(szHTTP_);
+                    pChar += strlen(szHTTP_);
                 }
                 strcpy(szTmpName, pChar);
                 axutil_string_replace(szTmpName, '_', '-');
                 http_header = axis2_http_header_create(env, szTmpName, pOpts + 1);
-                axutil_hash_set(headers, axutil_strdup(env, szTmpName), AXIS2_HASH_KEY_STRING, http_header);                
+                axutil_hash_set(headers, axutil_strdup(env, szTmpName), AXIS2_HASH_KEY_STRING,
+                    http_header);
                 pChar = pEnd + 1;
             }
         }
     }
     else
     {
-        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "axis2_iis_worker_read_http_headers: no http headers");
+        AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
+            "axis2_iis_worker_read_http_headers: no http headers");
     }
     return headers;
 }

Modified: webservices/axis2/trunk/c/src/core/transport/http/server/IIS/iis_iaspi_plugin_51/axis2_isapi_51.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/IIS/iis_iaspi_plugin_51/axis2_isapi_51.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/IIS/iis_iaspi_plugin_51/axis2_isapi_51.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/IIS/iis_iaspi_plugin_51/axis2_isapi_51.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
@@ -14,8 +13,8 @@
  * 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 <windows.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -40,114 +39,115 @@
  * scheme://server:port/axis2/other_parts
  * This function search  a give uri for the /axis2/. If a match
  * is found it will replace the /axis2 part of the url with /axis2/mod_iis.dll?
-*/
-axis2_bool_t AXIS2_CALL 
-get_extension_url(char url[], char ret_url[]);
+ */
+axis2_bool_t AXIS2_CALL
+get_extension_url(
+    char url[],
+    char ret_url[]);
 
 /*
  * This function is called by the IIS server at the server 
  * initialization. So this is the ideal plcae for initializing 
  * axis2c.
-*/ 
-BOOL WINAPI GetFilterVersion(PHTTP_FILTER_VERSION pVer) 
+ */
+BOOL WINAPI
+GetFilterVersion(
+    PHTTP_FILTER_VERSION pVer)
 {
-	DWORD type = 0, size = 0;
+    DWORD type = 0, size = 0;
     LONG lrc = 0;
-	char tmpbuf[INTERNET_MAX_URL_LENGTH];
-	HKEY hkey;
-	ULONG http_filter_revision = HTTP_FILTER_REVISION;
-	pVer->dwFilterVersion = pVer->dwServerFilterVersion;
-	if (pVer->dwFilterVersion > http_filter_revision)
-	{
-		pVer->dwFilterVersion = http_filter_revision;
-	}
-
-	/*
-	Receive notifictions when
-	1. Server preprocessed the headers.
-	2. Log 
-	3. All the request coming in secure and none secure ports.
-	*/ 
-	pVer->dwFlags =
-		(SF_NOTIFY_ORDER_HIGH | 
-		SF_NOTIFY_PREPROC_HEADERS |
-		SF_NOTIFY_SECURE_PORT | 
-		SF_NOTIFY_NONSECURE_PORT |
-		SF_NOTIFY_AUTH_COMPLETE 
-		);
-
-	/* Give a short discription about the module.*/
-	strcpy(pVer->lpszFilterDesc, "axis2c filter");
-	/* Get the axis2 location from the registry configuration */
-	lrc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGISTRY_LOC, (DWORD) 0, KEY_READ, &hkey);
-    if (ERROR_SUCCESS != lrc)
+    char tmpbuf[INTERNET_MAX_URL_LENGTH];
+    HKEY hkey;
+    ULONG http_filter_revision = HTTP_FILTER_REVISION;
+    pVer->dwFilterVersion = pVer->dwServerFilterVersion;
+    if(pVer->dwFilterVersion > http_filter_revision)
+    {
+        pVer->dwFilterVersion = http_filter_revision;
+    }
+
+    /*
+     Receive notifictions when
+     1. Server preprocessed the headers.
+     2. Log
+     3. All the request coming in secure and none secure ports.
+     */
+    pVer->dwFlags = (SF_NOTIFY_ORDER_HIGH | SF_NOTIFY_PREPROC_HEADERS | SF_NOTIFY_SECURE_PORT
+        | SF_NOTIFY_NONSECURE_PORT | SF_NOTIFY_AUTH_COMPLETE);
+
+    /* Give a short discription about the module.*/
+    strcpy(pVer->lpszFilterDesc, "axis2c filter");
+    /* Get the axis2 location from the registry configuration */
+    lrc = RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGISTRY_LOC, (DWORD)0, KEY_READ, &hkey);
+    if(ERROR_SUCCESS != lrc)
     {
         return FALSE;
     }
-	size = INTERNET_MAX_URL_LENGTH;
-    lrc = RegQueryValueEx(hkey, AXIS2_IIS_AXIS2_LOC, (LPDWORD) 0, &type, (LPBYTE) tmpbuf, &size);
-    if ((ERROR_SUCCESS == lrc) && (type == REG_SZ))
+    size = INTERNET_MAX_URL_LENGTH;
+    lrc = RegQueryValueEx(hkey, AXIS2_IIS_AXIS2_LOC, (LPDWORD)0, &type, (LPBYTE)tmpbuf, &size);
+    if((ERROR_SUCCESS == lrc) && (type == REG_SZ))
     {
         tmpbuf[size] = '\0';
-		axis2_loc = _strdup(tmpbuf);
-    } 
-	RegCloseKey(hkey);
-	return TRUE;
+        axis2_loc = _strdup(tmpbuf);
+    }
+    RegCloseKey(hkey);
+    return TRUE;
 }
 
 /*
-When a notification happens this function is called by the IIS.
-*/ 
-DWORD WINAPI HttpFilterProc(
-		PHTTP_FILTER_CONTEXT pfc,
-		DWORD notificationType,
-		LPVOID pvNotification) 
+ When a notification happens this function is called by the IIS.
+ */
+DWORD WINAPI
+HttpFilterProc(
+    PHTTP_FILTER_CONTEXT pfc,
+    DWORD notificationType,
+    LPVOID pvNotification)
 {
-	DWORD bufferLength = INTERNET_MAX_URL_LENGTH;
-	char url[INTERNET_MAX_URL_LENGTH];
-	char modified_url[INTERNET_MAX_URL_LENGTH];
-
-	if (notificationType == SF_NOTIFY_PREPROC_HEADERS)
-	{
-		pfc->GetServerVariable(pfc, "HTTP_URL", url, &bufferLength);
-		if (get_extension_url(url, modified_url))
-		{
-			((PHTTP_FILTER_PREPROC_HEADERS) pvNotification)->SetHeader(pfc,
-				"url",
-				modified_url);
-			return SF_STATUS_REQ_HANDLED_NOTIFICATION;
-		}
-	}
-	return SF_STATUS_REQ_NEXT_NOTIFICATION;
+    DWORD bufferLength = INTERNET_MAX_URL_LENGTH;
+    char url[INTERNET_MAX_URL_LENGTH];
+    char modified_url[INTERNET_MAX_URL_LENGTH];
+
+    if(notificationType == SF_NOTIFY_PREPROC_HEADERS)
+    {
+        pfc->GetServerVariable(pfc, "HTTP_URL", url, &bufferLength);
+        if(get_extension_url(url, modified_url))
+        {
+            ((PHTTP_FILTER_PREPROC_HEADERS)pvNotification)->SetHeader(pfc, "url", modified_url);
+            return SF_STATUS_REQ_HANDLED_NOTIFICATION;
+        }
+    }
+    return SF_STATUS_REQ_NEXT_NOTIFICATION;
 }
 
-axis2_bool_t AXIS2_CALL 
-get_extension_url(char url[], char ret_url[]) 
+axis2_bool_t AXIS2_CALL
+get_extension_url(
+    char url[],
+    char ret_url[])
 {
-	axis2_bool_t is_for_us = AXIS2_FALSE;
-	int i = 0;
+    axis2_bool_t is_for_us = AXIS2_FALSE;
+    int i = 0;
     /* Should contain "/axis2/"*/
-    ret_url[0] = '\0';	
-	if (strlen(url) >= strlen(axis2_loc))
+    ret_url[0] = '\0';
+    if(strlen(url) >= strlen(axis2_loc))
     {
-		is_for_us = AXIS2_TRUE;	
-		while (axis2_loc[i] != '\0')
-		{
-			if (axis2_loc[i] != (url)[i]) {
-				is_for_us = AXIS2_FALSE;
-				break;
-			}
-			i++;
-		}
-		if (url[i] != '/' && url[i] != '\0')
-		{
-			is_for_us = AXIS2_FALSE;
-		}
-	}
-	if (is_for_us)
-	{
-		strcpy(ret_url, redirect_word);
-		strcat(ret_url, &url[i]);
-	}
+        is_for_us = AXIS2_TRUE;
+        while(axis2_loc[i] != '\0')
+        {
+            if(axis2_loc[i] != (url)[i])
+            {
+                is_for_us = AXIS2_FALSE;
+                break;
+            }
+            i++;
+        }
+        if(url[i] != '/' && url[i] != '\0')
+        {
+            is_for_us = AXIS2_FALSE;
+        }
+    }
+    if(is_for_us)
+    {
+        strcpy(ret_url, redirect_word);
+        strcat(ret_url, &url[i]);
+    }
     return is_for_us;
-}
\ No newline at end of file
+}

Modified: webservices/axis2/trunk/c/src/core/transport/http/server/apache2/apache2_out_transport_info.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/apache2/apache2_out_transport_info.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/apache2/apache2_out_transport_info.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/apache2/apache2_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
@@ -40,7 +39,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;
 }
@@ -55,8 +54,8 @@
 
     info = AXIS2_INTF_TO_IMPL(out_transport_info);
 
-    info->request = NULL;       /* request doesn't belong to info */
-    if (info->encoding)
+    info->request = NULL; /* request doesn't belong to info */
+    if(info->encoding)
     {
         AXIS2_FREE(env->allocator, info->encoding);
         info->encoding = NULL;
@@ -81,7 +80,7 @@
     AXIS2_PARAM_CHECK(env->error, content_type, AXIS2_FAILURE);
     info = AXIS2_INTF_TO_IMPL(out_transport_info);
 
-    if (info->encoding)
+    if(info->encoding)
     {
 
         tmp1 = axutil_stracat(env, content_type, ";charset=");
@@ -92,8 +91,7 @@
     }
     else
     {
-        info->request->content_type = apr_pstrdup(info->request->pool,
-                                                  content_type);
+        info->request->content_type = apr_pstrdup(info->request->pool, content_type);
     }
     return AXIS2_SUCCESS;
 }
@@ -107,7 +105,7 @@
     AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK(env->error, encoding, AXIS2_FAILURE);
 
-    if (info->encoding)
+    if(info->encoding)
     {
         AXIS2_FREE(env->allocator, info->encoding);
     }
@@ -126,10 +124,10 @@
 
     AXIS2_ENV_CHECK(env, NULL);
 
-    info = (axis2_apache2_out_transport_info_t *) AXIS2_MALLOC
-        (env->allocator, sizeof(axis2_apache2_out_transport_info_t));
+    info = (axis2_apache2_out_transport_info_t *)AXIS2_MALLOC(env->allocator,
+        sizeof(axis2_apache2_out_transport_info_t));
 
-    if (!info)
+    if(!info)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -141,11 +139,10 @@
     out_transport_info->encoding = NULL;
     out_transport_info->response = NULL;
 
-    axis2_http_out_transport_info_set_char_encoding_func(out_transport_info,
-                                                         env,
-                                                         axis2_apache_out_transport_info_set_char_encoding);
+    axis2_http_out_transport_info_set_char_encoding_func(out_transport_info, env,
+        axis2_apache_out_transport_info_set_char_encoding);
     axis2_http_out_transport_info_set_content_type_func(out_transport_info, env,
-                                                        axis2_apache_out_transport_info_set_content_type);
+        axis2_apache_out_transport_info_set_content_type);
 
     return out_transport_info;
 }

Modified: webservices/axis2/trunk/c/src/core/transport/http/server/apache2/apache2_stream.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/apache2/apache2_stream.c?rev=805347&r1=805346&r2=805347&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/apache2/apache2_stream.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/apache2/apache2_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
@@ -30,7 +29,8 @@
 
 #define AXIS2_INTF_TO_IMPL(stream) ((apache2_stream_impl_t *)(stream))
 
-axutil_stream_type_t AXIS2_CALL apache2_stream_get_type(
+axutil_stream_type_t AXIS2_CALL
+apache2_stream_get_type(
     axutil_stream_t * stream,
     const axutil_env_t * env);
 
@@ -64,11 +64,10 @@
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, request, NULL);
 
-    stream_impl =
-        (apache2_stream_impl_t *) AXIS2_MALLOC(env->allocator,
-                                               sizeof(apache2_stream_impl_t));
+    stream_impl = (apache2_stream_impl_t *)AXIS2_MALLOC(env->allocator,
+        sizeof(apache2_stream_impl_t));
 
-    if (!stream_impl)
+    if(!stream_impl)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
@@ -100,11 +99,10 @@
 
     stream_impl = AXIS2_INTF_TO_IMPL(stream);
 
-    while (count - len > 0)
+    while(count - len > 0)
     {
-        read = ap_get_client_block(stream_impl->request, (char *) buffer + len,
-                                   count - len);
-        if (read > 0)
+        read = ap_get_client_block(stream_impl->request, (char *)buffer + len, count - len);
+        if(read > 0)
         {
             len += read;
         }
@@ -130,8 +128,8 @@
     AXIS2_ENV_CHECK(env, AXIS2_CRITICAL_FAILURE);
     AXIS2_PARAM_CHECK(env->error, buf, AXIS2_FAILURE);
     stream_impl = AXIS2_INTF_TO_IMPL(stream);
-    buffer = (axis2_char_t *) buf;
-    if (count <= 0)
+    buffer = (axis2_char_t *)buf;
+    if(count <= 0)
     {
         return (int)count;
         /* We are sure that the difference lies within the int range */
@@ -154,7 +152,7 @@
     stream_impl = AXIS2_INTF_TO_IMPL(stream);
 
     tmp_buffer = AXIS2_MALLOC(env->allocator, count * sizeof(axis2_char_t));
-    if (tmp_buffer == NULL)
+    if(tmp_buffer == NULL)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return -1;



Mime
View raw message