axis-c-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject svn commit: r1162726 - in /axis/axis2/c/core/trunk: src/core/transport/http/common/simple_http_svr_conn.c util/include/axutil_stream.h util/src/stream.c
Date Mon, 29 Aug 2011 10:54:57 GMT
Author: samisa
Date: Mon Aug 29 10:54:57 2011
New Revision: 1162726

URL: http://svn.apache.org/viewvc?rev=1162726&view=rev
Log:
fixing the peek to support SSL by applying patch given in AXIS2C-1556.

Modified:
    axis/axis2/c/core/trunk/src/core/transport/http/common/simple_http_svr_conn.c
    axis/axis2/c/core/trunk/util/include/axutil_stream.h
    axis/axis2/c/core/trunk/util/src/stream.c

Modified: axis/axis2/c/core/trunk/src/core/transport/http/common/simple_http_svr_conn.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/src/core/transport/http/common/simple_http_svr_conn.c?rev=1162726&r1=1162725&r2=1162726&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/src/core/transport/http/common/simple_http_svr_conn.c (original)
+++ axis/axis2/c/core/trunk/src/core/transport/http/common/simple_http_svr_conn.c Mon Aug
29 10:54:57 2011
@@ -421,7 +421,7 @@ axis2_simple_http_svr_conn_read_line(
     int read = -1;
 
     /* peek for 2047 characters to verify whether it contains CRLF character */
-    while((read = axutil_stream_peek_socket(svr_conn->stream, env, tmp_buf, 2048 - 1))
> 0)
+    while((read = axutil_stream_peek(svr_conn->stream, env, tmp_buf, 2048 - 1)) > 0)
     {
         axis2_char_t *start = tmp_buf;
         axis2_char_t *end = NULL;

Modified: axis/axis2/c/core/trunk/util/include/axutil_stream.h
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/util/include/axutil_stream.h?rev=1162726&r1=1162725&r2=1162726&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/util/include/axutil_stream.h (original)
+++ axis/axis2/c/core/trunk/util/include/axutil_stream.h Mon Aug 29 10:54:57 2011
@@ -76,6 +76,14 @@ extern "C"
             const axutil_env_t * env,
             int count);
 
+    typedef int(
+        AXIS2_CALL
+        * AXUTIL_STREAM_PEEK)(
+            axutil_stream_t * stream,
+            const axutil_env_t * env,
+            void *buffer,
+            size_t count);
+
     struct axutil_stream
     {
         axutil_stream_type_t stream_type;
@@ -130,6 +138,22 @@ extern "C"
                 axutil_stream_t * stream,
                 const axutil_env_t * env,
                 int count);
+
+
+        /**
+         * peeks into stream
+         * @param buffer buffer into which the content is to be read
+         * @param count size of the buffer
+         * @return no: of bytes read
+         */
+        int(
+            AXIS2_CALL
+            * peek)(
+                axutil_stream_t * stream,
+                const axutil_env_t * env,
+                void *buffer,
+                size_t count);
+
     };
 
     /**
@@ -183,6 +207,20 @@ extern "C"
         const axutil_env_t * env,
         int count);
 
+     /**
+    * peeks into stream
+    * @param buffer buffer into which the content is to be read
+    * @param count size of the buffer
+    * @return no: of bytes read
+    */
+    AXIS2_EXTERN int AXIS2_CALL
+    axutil_stream_peek(
+        axutil_stream_t * stream,
+        const axutil_env_t * env,
+        void *buffer,
+        int count);
+
+
     /**
      * Returns the length of the stream (applicable only to basic stream)
      * @return Length of the buffer if its type is basic, else -1
@@ -285,6 +323,13 @@ extern "C"
         const axutil_env_t * env,
         AXUTIL_STREAM_SKIP func);
 
+    AXIS2_EXTERN axis2_status_t AXIS2_CALL
+    axutil_stream_set_peek(
+        axutil_stream_t * stream,
+        const axutil_env_t * env,
+        AXUTIL_STREAM_PEEK func);
+
+
     /** @} */
 
 #ifdef __cplusplus

Modified: axis/axis2/c/core/trunk/util/src/stream.c
URL: http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/util/src/stream.c?rev=1162726&r1=1162725&r2=1162726&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/util/src/stream.c (original)
+++ axis/axis2/c/core/trunk/util/src/stream.c Mon Aug 29 10:54:57 2011
@@ -501,6 +501,7 @@ axutil_stream_create_socket(
     stream->read = axutil_stream_read_socket;
     stream->write = axutil_stream_write_socket;
     stream->skip = axutil_stream_skip_socket;
+    stream->peek = axutil_stream_peek_socket;
     stream->stream_type = AXIS2_STREAM_SOCKET;
     stream->socket = socket;
     stream->fp = NULL;
@@ -689,6 +690,16 @@ axutil_stream_set_skip(
     return AXIS2_SUCCESS;
 }
 
+AXIS2_EXTERN axis2_status_t AXIS2_CALL
+axutil_stream_set_peek(
+    axutil_stream_t *stream,
+    const axutil_env_t *env,
+    AXUTIL_STREAM_PEEK func)
+{
+    stream->peek = func;
+    return AXIS2_SUCCESS;
+}
+
 AXIS2_EXTERN int AXIS2_CALL
 axutil_stream_read(
     axutil_stream_t *stream,
@@ -717,3 +728,14 @@ axutil_stream_skip(
 {
     return stream->skip(stream, env, count);
 }
+
+AXIS2_EXTERN int AXIS2_CALL
+axutil_stream_peek(
+    axutil_stream_t *stream,
+    const axutil_env_t *env,
+    void *buffer,
+    int count)
+{
+    return stream->peek(stream, env, buffer, count);
+}
+



Mime
View raw message