axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shan...@apache.org
Subject svn commit: r810528 - in /webservices/axis2/trunk/c/util/src: http_chunked_stream.c network_handler.c stream.c
Date Wed, 02 Sep 2009 14:43:24 GMT
Author: shankar
Date: Wed Sep  2 14:43:24 2009
New Revision: 810528

URL: http://svn.apache.org/viewvc?rev=810528&view=rev
Log:
code formatting + refactor + improving performance

Modified:
    webservices/axis2/trunk/c/util/src/http_chunked_stream.c
    webservices/axis2/trunk/c/util/src/network_handler.c
    webservices/axis2/trunk/c/util/src/stream.c

Modified: webservices/axis2/trunk/c/util/src/http_chunked_stream.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/http_chunked_stream.c?rev=810528&r1=810527&r2=810528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/http_chunked_stream.c (original)
+++ webservices/axis2/trunk/c/util/src/http_chunked_stream.c Wed Sep  2 14:43:24 2009
@@ -42,12 +42,10 @@
     axutil_stream_t *stream)
 {
     axutil_http_chunked_stream_t *chunked_stream = NULL;
-    AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, stream, NULL);
 
     chunked_stream = (axutil_http_chunked_stream_t *)AXIS2_MALLOC(env->allocator,
         sizeof(axutil_http_chunked_stream_t));
-
     if(!chunked_stream)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
@@ -68,10 +66,7 @@
     axutil_http_chunked_stream_t *chunked_stream,
     const axutil_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, void);
-
     AXIS2_FREE(env->allocator, chunked_stream);
-    return;
 }
 
 AXIS2_EXTERN int AXIS2_CALL

Modified: webservices/axis2/trunk/c/util/src/network_handler.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/network_handler.c?rev=810528&r1=810527&r2=810528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/network_handler.c (original)
+++ webservices/axis2/trunk/c/util/src/network_handler.c Wed Sep  2 14:43:24 2009
@@ -187,7 +187,6 @@
 {
     int i = 0;
     char buf[32];
-    AXIS2_ENV_CHECK(env, AXIS2_CRITICAL_FAILURE);
     if(socket < 0)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_INVALID_SOCKET, AXIS2_FAILURE);

Modified: webservices/axis2/trunk/c/util/src/stream.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/stream.c?rev=810528&r1=810527&r2=810528&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/stream.c (original)
+++ webservices/axis2/trunk/c/util/src/stream.c Wed Sep  2 14:43:24 2009
@@ -79,14 +79,11 @@
     const axutil_env_t *env)
 {
     axutil_stream_t *stream = NULL;
-    AXIS2_ENV_CHECK(env, NULL);
-
     stream = (axutil_stream_t *)AXIS2_MALLOC(env->allocator, sizeof(axutil_stream_t));
-
     if(!stream)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Out of memory");
+        AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Out of memory. Cannot create axutil stream");
         return NULL;
     }
     stream->buffer = NULL;
@@ -105,8 +102,6 @@
     axutil_stream_t *stream,
     const axutil_env_t *env)
 {
-    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
     switch(stream->stream_type)
     {
         case AXIS2_STREAM_BASIC:
@@ -140,8 +135,6 @@
     }
 
     AXIS2_FREE(env->allocator, stream);
-
-    return;
 }
 
 void AXIS2_CALL
@@ -495,8 +488,6 @@
     int socket)
 {
     axutil_stream_t *stream = NULL;
-
-    AXIS2_ENV_CHECK(env, NULL);
     stream = axutil_stream_create_internal(env);
     if(!stream)
     {
@@ -510,7 +501,6 @@
     stream->read = axutil_stream_read_socket;
     stream->write = axutil_stream_write_socket;
     stream->skip = axutil_stream_skip_socket;
-
     stream->stream_type = AXIS2_STREAM_SOCKET;
     stream->socket = socket;
     stream->fp = NULL;
@@ -526,9 +516,6 @@
     size_t count)
 {
     int len = 0;
-#ifdef AXIS2_TCPMON
-    axis2_char_t *temp = NULL;
-#endif
 
     if(-1 == stream->socket)
     {
@@ -547,9 +534,8 @@
 #ifdef AXIS2_TCPMON
     if (len > 1)
     {
-        temp =
-        (axis2_char_t *) AXIS2_MALLOC(env->allocator,
-            (len + 1) * sizeof(axis2_char_t));
+        axis2_char_t *temp = NULL;
+        temp = (axis2_char_t *) AXIS2_MALLOC(env->allocator, (len + 1) * sizeof(axis2_char_t));
         if (temp)
         {
             memcpy(temp, buffer, len * sizeof(axis2_char_t));



Mime
View raw message