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 se...@apache.org on 2008/02/20 11:47:32 UTC

svn commit: r629412 - in /webservices/axis2/trunk/c/src/core/transport/http/server/IIS: axis2_iis_stream.c axis2_iis_worker.c

Author: senaka
Date: Wed Feb 20 02:47:29 2008
New Revision: 629412

URL: http://svn.apache.org/viewvc?rev=629412&view=rev
Log:
Fixing JIRA Issues AXIS2C-573, AXIS2C-941

Modified:
    webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_stream.c
    webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_worker.c

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=629412&r1=629411&r2=629412&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 Wed Feb 20 02:47:29 2008
@@ -121,7 +121,7 @@
             data_to_read = (unsigned) count;
         else
             data_to_read =
-                stream_impl->lpECB->cbAvailable - stream_impl->cur_pos;
+                stream_impl->lpECB->cbTotalBytes - stream_impl->cur_pos;
 
         memcpy(buffer, stream_impl->cur_position, data_to_read);
         temp = (char *)(stream_impl->cur_position);
@@ -148,22 +148,31 @@
         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;
+            else
+                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 + count - stream_impl->lpECB->cbAvailable;
+                stream_impl->cur_pos + read_length - stream_impl->lpECB->cbAvailable;
             temp_buff = malloc(read_bytes);
 
             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 + 1), 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;
         }
         else
         {

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=629412&r1=629411&r2=629412&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 Wed Feb 20 02:47:29 2008
@@ -38,7 +38,7 @@
 
 #include "axis2_iis_constants.h"
 
-#define READ_SIZE  32
+#define READ_SIZE  2048
 
 axis2_status_t AXIS2_CALL 
 axis2_worker_get_original_url(char url[],
@@ -516,11 +516,12 @@
     axutil_stream_t * tmp_stream = NULL;
     int return_size = -1;
     axis2_char_t * buffer = NULL;
+    axis2_bool_t loop_state = AXIS2_TRUE;
     AXIS2_ENV_CHECK(env, NULL);
     AXIS2_PARAM_CHECK(env->error, stream, NULL);
 
     tmp_stream = axutil_stream_create_basic(env);
-    while (1)
+    while (loop_state)
     {
         int read = 0;
         int write = 0;



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