axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dami...@apache.org
Subject svn commit: r467307 - in /webservices/axis2/trunk/c: include/axis2_msg_ctx.h modules/core/context/msg_ctx.c modules/core/receivers/msg_recv.c modules/core/transport/http/http_worker.c
Date Tue, 24 Oct 2006 11:09:33 GMT
Author: damitha
Date: Tue Oct 24 04:09:32 2006
New Revision: 467307

URL: http://svn.apache.org/viewvc?view=rev&rev=467307
Log:
Fix AXIS2C-307

Modified:
    webservices/axis2/trunk/c/include/axis2_msg_ctx.h
    webservices/axis2/trunk/c/modules/core/context/msg_ctx.c
    webservices/axis2/trunk/c/modules/core/receivers/msg_recv.c
    webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c

Modified: webservices/axis2/trunk/c/include/axis2_msg_ctx.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_msg_ctx.h?view=diff&rev=467307&r1=467306&r2=467307
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_msg_ctx.h (original)
+++ webservices/axis2/trunk/c/include/axis2_msg_ctx.h Tue Oct 24 04:09:32 2006
@@ -613,6 +613,35 @@
                     const axis2_bool_t paused);
 
         /**
+         * Gets the bool value indicating the keep value status. It is possible 
+         * to keep alive the message context by any handler. By calling this method
+         * one can see whether it is possible to clean the message context.
+         * @param msg_ctx message context
+         * @param env pointer to environment struct
+         * @return AXIS2_TRUE if message context is keep alive, else AXIS2_FALSE
+         */
+        axis2_bool_t (AXIS2_CALL *
+                is_keep_alive)(
+                    const axis2_msg_ctx_t *msg_ctx,
+                    const axis2_env_t *env);
+
+        /**
+         * Sets the bool value indicating the keep alive status of invocation.
+         * By setting this one can indicate the engine not to clean the message 
+         * context.
+         * @param msg_ctx message context
+         * @param env pointer to environment struct
+         * @param keep_alive keep alive
+         * @return AXIS2_SUCCESS on success, else AXIS2_FAILURE
+         */
+        axis2_status_t (AXIS2_CALL *
+                set_keep_alive)(
+                    axis2_msg_ctx_t *msg_ctx,
+                    const axis2_env_t *env,
+                    const axis2_bool_t keep_alive);
+
+
+        /**
          * Gets transport in description.
          * @param msg_ctx message context
          * @param env pointer to environment struct
@@ -1586,6 +1615,17 @@
     @sa axis2_msg_ctx_ops#set_paused */
 #define AXIS2_MSG_CTX_SET_PAUSED(msg_ctx, env, paused) \
       ((msg_ctx)->ops->set_paused(msg_ctx, env, paused))
+
+/** Gets bool value indicating the keep alive status of invocation.
+    @sa axis2_msg_ctx_ops#is_keep_alive */
+#define AXIS2_MSG_CTX_IS_KEEP_ALIVE(msg_ctx, env) \
+      ((msg_ctx)->ops->is_keep_alive(msg_ctx, env))
+
+/** Sets bool value indicating the keep alive status of invocation.
+    @sa axis2_msg_ctx_ops#set_keep_alive */
+#define AXIS2_MSG_CTX_SET_KEEP_ALIVE(msg_ctx, env, keep_alive) \
+      ((msg_ctx)->ops->set_keep_alive(msg_ctx, env, keep_alive))
+
 
 /** Gets transport in description.
     @sa axis2_msg_ctx_ops#get_transport_in_desc */

Modified: webservices/axis2/trunk/c/modules/core/context/msg_ctx.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/context/msg_ctx.c?view=diff&rev=467307&r1=467306&r2=467307
==============================================================================
--- webservices/axis2/trunk/c/modules/core/context/msg_ctx.c (original)
+++ webservices/axis2/trunk/c/modules/core/context/msg_ctx.c Tue Oct 24 04:09:32 2006
@@ -81,6 +81,7 @@
     axis2_bool_t new_thread_required;
     /** paused */
     axis2_bool_t paused;
+    axis2_bool_t keep_alive;
     /** output written? */
     axis2_bool_t output_written;
     /** service context ID */
@@ -335,6 +336,17 @@
     const axis2_env_t *env,
     axis2_bool_t paused);
 
+axis2_bool_t AXIS2_CALL
+axis2_msg_ctx_is_keep_alive(
+    const axis2_msg_ctx_t *msg_ctx,
+    const axis2_env_t *env);
+
+axis2_status_t AXIS2_CALL
+axis2_msg_ctx_set_keep_alive(
+    struct axis2_msg_ctx *msg_ctx,
+    const axis2_env_t *env,
+    axis2_bool_t keep_alive);
+
 struct axis2_transport_in_desc *AXIS2_CALL
             axis2_msg_ctx_get_transport_in_desc(
                 const axis2_msg_ctx_t *msg_ctx,
@@ -688,6 +700,7 @@
     msg_ctx_impl->message_id = NULL;
     msg_ctx_impl->new_thread_required = AXIS2_FALSE;
     msg_ctx_impl->paused = AXIS2_FALSE;
+    msg_ctx_impl->keep_alive = AXIS2_FALSE;
     msg_ctx_impl->output_written = AXIS2_FALSE;
     msg_ctx_impl->svc_ctx_id = NULL;
     msg_ctx_impl->paused_phase_name = NULL;
@@ -785,6 +798,8 @@
     msg_ctx_impl->msg_ctx.ops->get_msg_info_headers = axis2_msg_ctx_get_msg_info_headers;
     msg_ctx_impl->msg_ctx.ops->get_paused = axis2_msg_ctx_get_paused;
     msg_ctx_impl->msg_ctx.ops->set_paused = axis2_msg_ctx_set_paused;
+    msg_ctx_impl->msg_ctx.ops->set_keep_alive = axis2_msg_ctx_set_keep_alive;
+    msg_ctx_impl->msg_ctx.ops->is_keep_alive = axis2_msg_ctx_is_keep_alive;
     msg_ctx_impl->msg_ctx.ops->get_transport_in_desc = axis2_msg_ctx_get_transport_in_desc;
     msg_ctx_impl->msg_ctx.ops->get_transport_out_desc = axis2_msg_ctx_get_transport_out_desc;
     msg_ctx_impl->msg_ctx.ops->set_transport_in_desc = axis2_msg_ctx_set_transport_in_desc;
@@ -1559,6 +1574,29 @@
     msg_ctx_impl->paused = paused;
     msg_ctx_impl->paused_phase_index = msg_ctx_impl->current_phase_index;
     return AXIS2_SUCCESS;
+}
+
+axis2_status_t AXIS2_CALL
+axis2_msg_ctx_set_keep_alive(
+    struct axis2_msg_ctx *msg_ctx,
+    const axis2_env_t *env,
+    axis2_bool_t keep_alive)
+{
+    axis2_msg_ctx_impl_t *msg_ctx_impl = NULL;
+
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    msg_ctx_impl = AXIS2_INTF_TO_IMPL(msg_ctx);
+    msg_ctx_impl->keep_alive = keep_alive;
+    return AXIS2_SUCCESS;
+}
+
+axis2_bool_t AXIS2_CALL
+axis2_msg_ctx_is_keep_alive(
+    const axis2_msg_ctx_t *msg_ctx,
+    const axis2_env_t *env)
+{
+    AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+    return AXIS2_INTF_TO_IMPL(msg_ctx)->keep_alive;
 }
 
 struct axis2_transport_in_desc *AXIS2_CALL

Modified: webservices/axis2/trunk/c/modules/core/receivers/msg_recv.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/receivers/msg_recv.c?view=diff&rev=467307&r1=467306&r2=467307
==============================================================================
--- webservices/axis2/trunk/c/modules/core/receivers/msg_recv.c (original)
+++ webservices/axis2/trunk/c/modules/core/receivers/msg_recv.c Tue Oct 24 04:09:32 2006
@@ -476,7 +476,10 @@
     /* test code: uncomment this when test is over */ 
     axis2_core_utils_reset_out_msg_ctx(env, out_msg_ctx);
     if (!AXIS2_MSG_CTX_IS_PAUSED(out_msg_ctx, env))
+    {
         AXIS2_MSG_CTX_FREE(out_msg_ctx, env);
+        out_msg_ctx = NULL;
+    }
     /*end test code */
     return status;
 }

Modified: webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c?view=diff&rev=467307&r1=467306&r2=467307
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/http_worker.c Tue Oct 24 04:09:32
2006
@@ -438,11 +438,11 @@
     status = AXIS2_SIMPLE_HTTP_SVR_CONN_WRITE_RESPONSE(svr_conn, env, response);
     AXIS2_FREE(env->allocator, url_external_form);
     url_external_form = NULL;
-    /*
-    AXIS2_MSG_CTX_FREE(msg_ctx, env);
-    
-    msg_ctx = NULL;
-    */
+    if (!AXIS2_MSG_CTX_IS_KEEP_ALIVE(msg_ctx, env))
+    {
+        AXIS2_MSG_CTX_FREE(msg_ctx, env);
+        msg_ctx = NULL;
+    }
     AXIS2_URL_FREE(request_url, env);
     request_url = NULL;
     AXIS2_HTTP_SIMPLE_RESPONSE_FREE(response, env);



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


Mime
View raw message