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 2006/03/17 08:11:49 UTC

svn commit: r386560 - in /webservices/axis2/trunk/c/modules: core/transport/http/ core/transport/http/sender/ core/transport/http/server/apache2/ core/transport/http/server/simple_axis2_server/ util/

Author: sahan
Date: Thu Mar 16 23:11:47 2006
New Revision: 386560

URL: http://svn.apache.org/viewcvs?rev=386560&view=rev
Log:
Warning elimination. Added axis2_types to hold type conversion.

Added:
    webservices/axis2/trunk/c/modules/util/axis2_types.h
    webservices/axis2/trunk/c/modules/util/types.c
Modified:
    webservices/axis2/trunk/c/modules/core/transport/http/http_chunked_stream.c
    webservices/axis2/trunk/c/modules/core/transport/http/http_header.c
    webservices/axis2/trunk/c/modules/core/transport/http/http_simple_request.c
    webservices/axis2/trunk/c/modules/core/transport/http/http_simple_response.c
    webservices/axis2/trunk/c/modules/core/transport/http/http_status_line.c
    webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c
    webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c
    webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_stream.c
    webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c
    webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c
    webservices/axis2/trunk/c/modules/core/transport/http/server/simple_axis2_server/http_server_main.c
    webservices/axis2/trunk/c/modules/core/transport/http/url.c
    webservices/axis2/trunk/c/modules/util/Makefile.am

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_chunked_stream.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/http_chunked_stream.c?rev=386560&r1=386559&r2=386560&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_chunked_stream.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_chunked_stream.c Thu Mar 16 23:11:47 2006
@@ -18,6 +18,7 @@
 #include <axis2_string.h>
 #include <string.h>
 #include <axis2_http_transport.h>
+#include <stdlib.h>
 
 /** 
  * @brief HTTP Chunked Stream struct impl

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_header.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/http_header.c?rev=386560&r1=386559&r2=386560&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_header.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_header.c Thu Mar 16 23:11:47 2006
@@ -18,6 +18,7 @@
 #include <axis2_string.h>
 #include <axis2_http_transport.h>
 #include <stdio.h>
+#include <string.h>
 
 /** 
  * @brief HTTP Header struct impl
@@ -112,7 +113,7 @@
 		tmp_str[AXIS2_STRLEN(tmp_str)-2] = '\0';
 	}
 	
-	ch = strchr(tmp_str, ':');
+	ch = strchr((const char*)tmp_str, ':');
 	if(NULL == ch)
 	{
 		AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_INVALID_HEADER, 
@@ -167,10 +168,10 @@
     AXIS2_ENV_CHECK(env, NULL);
     http_header_impl = AXIS2_INTF_TO_IMPL(header);
     len = AXIS2_STRLEN(http_header_impl->name) + 
-                AXIS2_STRLEN(http_header_impl->value) + 4;
+                AXIS2_STRLEN(http_header_impl->value) + 8;
     external_form = (axis2_char_t*) AXIS2_MALLOC((*env)->allocator,
                 len);
-    sprintf(external_form, "%s:%s%s", http_header_impl->name, 
+    sprintf(external_form, "%s: %s%s", http_header_impl->name, 
                 http_header_impl->value, AXIS2_HTTP_CRLF);
     return external_form;
 }

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_simple_request.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/http_simple_request.c?rev=386560&r1=386559&r2=386560&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_simple_request.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_simple_request.c Thu Mar 16 23:11:47 2006
@@ -19,6 +19,7 @@
 #include <axis2_http_transport.h>
 #include <axis2_string.h>
 #include <string.h>
+#include <axis2_types.h>
 
 /** 
  * @brief HTTP Simple Request struct impl
@@ -465,7 +466,7 @@
                         (simple_request, env, AXIS2_HTTP_HEADER_CONTENT_LENGTH);
     if(NULL != tmp_header)
     {
-        return atoi(AXIS2_HTTP_HEADER_GET_VALUE(tmp_header, env));
+        return AXIS2_ATOI(AXIS2_HTTP_HEADER_GET_VALUE(tmp_header, env));
     }
     return -1;
 }

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_simple_response.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/http_simple_response.c?rev=386560&r1=386559&r2=386560&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_simple_response.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_simple_response.c Thu Mar 16 23:11:47 2006
@@ -18,6 +18,7 @@
 #include <axis2_string.h>
 #include <stdio.h>
 #include <string.h>
+#include <axis2_types.h>
 
 /** 
  * @brief HTTP Simple Response struct impl
@@ -559,7 +560,7 @@
                         (simple_response, env, AXIS2_HTTP_HEADER_CONTENT_LENGTH);
     if(NULL != tmp_header)
     {
-        return atoi(AXIS2_HTTP_HEADER_GET_VALUE(tmp_header, env));
+        return AXIS2_ATOI(AXIS2_HTTP_HEADER_GET_VALUE(tmp_header, env));
     }
     return -1;
 }

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_status_line.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/http_status_line.c?rev=386560&r1=386559&r2=386560&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_status_line.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_status_line.c Thu Mar 16 23:11:47 2006
@@ -18,6 +18,7 @@
 #include <axis2_string.h>
 #include <axis2_http_transport.h>
 #include <string.h>
+#include <axis2_types.h>
 
 /** 
  * @brief HTTP Status Line struct impl
@@ -227,7 +228,7 @@
     AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
     if(NULL != AXIS2_INTF_TO_IMPL(status_line)->status_code)
     {
-        return atoi(AXIS2_INTF_TO_IMPL(status_line)->status_code);
+        return AXIS2_ATOI(AXIS2_INTF_TO_IMPL(status_line)->status_code);
     }
     else
     {

Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c?rev=386560&r1=386559&r2=386560&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/sender/http_transport_sender.c Thu Mar 16 23:11:47 2006
@@ -24,6 +24,7 @@
 #include <axis2_http_out_transport_info.h>
 #include <axis2_http_transport.h>
 #include <axis2_soap_over_http_sender.h>
+#include <axis2_types.h>
 
 
 /** 
@@ -438,7 +439,7 @@
 	}
 	if(NULL != temp)
 	{
-		AXIS2_INTF_TO_IMPL(transport_sender)->so_timeout = atoi(temp);
+		AXIS2_INTF_TO_IMPL(transport_sender)->so_timeout = AXIS2_ATOI(temp);
 	}
 	temp = (axis2_char_t *)AXIS2_PARAM_CONTAINER_GET_PARAM(
 							out_desc->param_container, env, 
@@ -449,7 +450,8 @@
 	}
 	if(NULL != temp)
 	{
-		AXIS2_INTF_TO_IMPL(transport_sender)->connection_timeout=atoi(temp);
+		AXIS2_INTF_TO_IMPL(transport_sender)->connection_timeout = 
+                        AXIS2_ATOI(temp);
 	}
 
 	return AXIS2_SUCCESS;

Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c?rev=386560&r1=386559&r2=386560&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c Thu Mar 16 23:11:47 2006
@@ -24,6 +24,7 @@
 #include <axis2_http_client.h>
 #include <axis2_xml_writer.h>
 #include <axis2_property.h>
+#include <axis2_types.h>
 
 /** 
  * @brief SOAP over HTTP sender struct impl
@@ -486,11 +487,11 @@
 						env, AXIS2_HTTP_CONNECTION_TIMEOUT);
 	if(NULL != so_str)
 	{
-		AXIS2_INTF_TO_IMPL(sender)->so_timeout = atoi(so_str);
+		AXIS2_INTF_TO_IMPL(sender)->so_timeout = AXIS2_ATOI(so_str);
 	}
 	if(NULL != connection_str)
 	{
-		AXIS2_INTF_TO_IMPL(sender)->connection_timeout = atoi(connection_str);
+		AXIS2_INTF_TO_IMPL(sender)->connection_timeout = AXIS2_ATOI(connection_str);
 	}
     
 	return AXIS2_SUCCESS;

Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_stream.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_stream.c?rev=386560&r1=386559&r2=386560&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_stream.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_stream.c Thu Mar 16 23:11:47 2006
@@ -201,4 +201,5 @@
 {
     AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
     return AXIS2_INTF_TO_IMPL(stream)->stream_type;
-}
\ No newline at end of file
+}
+

Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c?rev=386560&r1=386559&r2=386560&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c Thu Mar 16 23:11:47 2006
@@ -370,3 +370,4 @@
     AXIS2_STREAM_FREE(tmp_stream, env);
     return buffer;
 }
+

Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c?rev=386560&r1=386559&r2=386560&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/mod_axis2.c Thu Mar 16 23:11:47 2006
@@ -36,7 +36,7 @@
 axis2_env_t *axis2_env = NULL;
 
 /******************************Function Headers********************************/
-static void * axis2_create_svr(apr_pool_t *p, char *d);
+static void * axis2_create_svr(apr_pool_t *p, server_rec *s);
 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, void *dummy, 
@@ -66,7 +66,7 @@
     axis2_register_hooks   /* register hooks                      */
 };
 
-static void * axis2_create_svr(apr_pool_t *p, char *d)
+static void * axis2_create_svr(apr_pool_t *p, server_rec *s)
 {
     axis2_config_rec_t *conf = apr_palloc(p, sizeof(*conf));
     conf->axis2_log_file = NULL;

Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/simple_axis2_server/http_server_main.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/server/simple_axis2_server/http_server_main.c?rev=386560&r1=386559&r2=386560&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/simple_axis2_server/http_server_main.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/simple_axis2_server/http_server_main.c Thu Mar 16 23:11:47 2006
@@ -23,6 +23,7 @@
 #include <axis2_log_default.h>
 #include <axis2_thread_pool.h>
 #include <signal.h>
+#include <axis2_types.h>
 
 
 axis2_env_t *system_env = NULL;
@@ -75,16 +76,16 @@
         switch(c)
         {
             case 'p':
-                port = atoi(optarg);
+                port = AXIS2_ATOI(optarg);
                 break;
             case 'r':
                 repo_path = optarg;
                 break;
             case 't':
-                axis2_http_socket_read_timeout = atoi(optarg) * 1000;
+                axis2_http_socket_read_timeout = AXIS2_ATOI(optarg) * 1000;
                 break;
             case 'l':
-                log_level = atoi(optarg);
+                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)

Modified: webservices/axis2/trunk/c/modules/core/transport/http/url.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/core/transport/http/url.c?rev=386560&r1=386559&r2=386560&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/url.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/url.c Thu Mar 16 23:11:47 2006
@@ -19,6 +19,7 @@
 #include <axis2_string.h>
 #include <axis2_file_handler.h>
 #include <axis2_network_handler.h>
+#include <axis2_types.h>
 
 
 /** 
@@ -223,7 +224,7 @@
 			{
 				*params = '\0';
 			}
-			port = atoi(port_str);
+			port = AXIS2_ATOI(port_str);
 			/* here we have protocol + server + port + def path */
 			ret = axis2_url_create(env, protocol, server, port, "/");
 			AXIS2_FREE((*env)->allocator, tmp_url_str);
@@ -232,7 +233,7 @@
 		else
 		{
 			*path++ = '\0';
-			port = atoi(port_str);
+			port = AXIS2_ATOI(port_str);
 			params = strchr(path, '?');
 			if(NULL != params)
 			{

Modified: webservices/axis2/trunk/c/modules/util/Makefile.am
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/Makefile.am?rev=386560&r1=386559&r2=386560&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/util/Makefile.am (original)
+++ webservices/axis2/trunk/c/modules/util/Makefile.am Thu Mar 16 23:11:47 2006
@@ -31,7 +31,8 @@
                         file.c\
                         uuid_gen.c\
                         thread_pool.c \
-                        property.c
+                        property.c \
+                        types.c
 
 INCLUDES = -I$(top_builddir)/include \
             -I$(top_builddir)/modules/util \

Added: webservices/axis2/trunk/c/modules/util/axis2_types.h
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/axis2_types.h?rev=386560&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/util/axis2_types.h (added)
+++ webservices/axis2/trunk/c/modules/util/axis2_types.h Thu Mar 16 23:11:47 2006
@@ -0,0 +1,46 @@
+/**
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.
+ */
+
+#ifndef AXIS2_TYPES_H
+#define AXIS2_TYPES_H
+
+#include <axis2_defines.h>
+#include <axis2_error.h>
+#include <axis2_env.h>
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/**
+ * @defgroup axis2_types Types
+ * @ingroup axis2_util 
+ * @{
+ */
+
+    AXIS2_DECLARE(int)
+    axis2_atoi (const char *s);
+
+#define AXIS2_ATOI(s) axis2_atoi(s)
+
+/** @} */
+    
+#ifdef __cplusplus
+}
+#endif
+
+#endif                          /* AXIS2_TYPES_H */

Added: webservices/axis2/trunk/c/modules/util/types.c
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/c/modules/util/types.c?rev=386560&view=auto
==============================================================================
--- webservices/axis2/trunk/c/modules/util/types.c (added)
+++ webservices/axis2/trunk/c/modules/util/types.c Thu Mar 16 23:11:47 2006
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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_types.h>
+
+AXIS2_DECLARE(int)
+axis2_atoi (const char *s)
+{
+    int i,n;
+    
+    n = 0;
+    for(i = 0; s[i] >= '0' && s[i] <= '9'; ++i)
+    {
+        n = 10 * n + (s[i] - '0');
+    }
+    return n;
+}