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 2007/04/01 06:57:55 UTC

svn commit: r524529 - in /webservices/axis2/trunk/c/modules/core/transport/http/server: IIS/axis2_iis_worker.c IIS/axis2_iis_worker.h apache2/apache2_worker.c apache2/axis2_apache2_worker.h

Author: samisa
Date: Sat Mar 31 21:57:54 2007
New Revision: 524529

URL: http://svn.apache.org/viewvc?view=rev&rev=524529
Log:
Removed ops

Modified:
    webservices/axis2/trunk/c/modules/core/transport/http/server/IIS/axis2_iis_worker.c
    webservices/axis2/trunk/c/modules/core/transport/http/server/IIS/axis2_iis_worker.h
    webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c
    webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/axis2_apache2_worker.h

Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/IIS/axis2_iis_worker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/server/IIS/axis2_iis_worker.c?view=diff&rev=524529&r1=524528&r2=524529
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/IIS/axis2_iis_worker.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/IIS/axis2_iis_worker.c Sat Mar 31 21:57:54 2007
@@ -49,40 +49,11 @@
 	{"500 Internal Server Error", 25}
 	};	
 
-typedef struct axis2_iis_worker_impl
+struct axis2_iis_worker
 {
-    axis2_iis_worker_t iis_worker;
     axis2_conf_ctx_t *conf_ctx;
-}
-axis2_iis_worker_impl_t;
-
+};
 
-#define AXIS2_INTF_TO_IMPL(iis_worker) ((axis2_iis_worker_impl_t *)\
-                        (iis_worker))
-int AXIS2_CALL
-axis2_iis_worker_process_request(
-    axis2_iis_worker_t *iis_worker,
-    const axutil_env_t *env,
-    LPEXTENSION_CONTROL_BLOCK lpECB);
-
-axis2_char_t *AXIS2_CALL
-axis2_iis_worker_get_bytes(
-    const axutil_env_t *env,
-    axutil_stream_t *stream);
-
-void AXIS2_CALL
-axis2_iis_worker_free(
-    axis2_iis_worker_t *iis_worker,
-    const axutil_env_t *env);
-
-axis2_status_t axis2_worker_get_original_url(char url[], char ret_url[]);
-axis2_status_t write_response(LPEXTENSION_CONTROL_BLOCK lpECB, const void *b, unsigned int l);
-axis2_status_t start_response(LPEXTENSION_CONTROL_BLOCK lpECB,
-                                    int status,
-                                    const char *reason,
-                                    const char *const *header_names,
-                                    const char *const *header_values,
-                                    unsigned int num_of_headers);
 char *status_reason(int status);
 
 axis2_iis_worker_t * AXIS2_CALL
@@ -90,42 +61,26 @@
     const axutil_env_t *env, 
     axis2_char_t *repo_path)
 {
-    axis2_iis_worker_impl_t *iis_worker_impl = NULL;
+    axis2_iis_worker_t *iis_worker = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    iis_worker_impl = (axis2_iis_worker_impl_t *)
-            AXIS2_MALLOC(env->allocator, sizeof(axis2_iis_worker_impl_t));
+    iis_worker = (axis2_iis_worker_t *)
+            AXIS2_MALLOC(env->allocator, sizeof(axis2_iis_worker_t));
 
-    if (! iis_worker_impl)
+    if (! iis_worker)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    iis_worker_impl->iis_worker.ops = NULL;
-    iis_worker_impl->conf_ctx = axis2_build_conf_ctx(env, repo_path);
-
-    if (! iis_worker_impl->conf_ctx)
-    {
-        axis2_iis_worker_free((axis2_iis_worker_t *)iis_worker_impl,
-                env);
-        return NULL;
-    }
-    iis_worker_impl->iis_worker.ops = AXIS2_MALLOC(env->allocator,
-            sizeof(axis2_iis_worker_ops_t));
+    iis_worker->conf_ctx = axis2_build_conf_ctx(env, repo_path);
 
-    if (! iis_worker_impl->iis_worker.ops)
+    if (! iis_worker->conf_ctx)
     {
-        axis2_iis_worker_free((axis2_iis_worker_t *)iis_worker_impl,
+        axis2_iis_worker_free((axis2_iis_worker_t *)iis_worker,
                 env);
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
 
-	// Set the operations to the functions
-    iis_worker_impl->iis_worker.ops->process_request =
-        axis2_iis_worker_process_request;
-    iis_worker_impl->iis_worker.ops->free = axis2_iis_worker_free;
-
-    return &(iis_worker_impl->iis_worker);	
+    return iis_worker;	
 }
 
 void AXIS2_CALL
@@ -133,20 +88,15 @@
     axis2_iis_worker_t *iis_worker,
     const axutil_env_t *env)
 {
-    axis2_iis_worker_impl_t *worker_impl = NULL;
     AXIS2_ENV_CHECK(env, void);
 
-    worker_impl = AXIS2_INTF_TO_IMPL(iis_worker);
-    if (worker_impl->conf_ctx)
+    if (iis_worker->conf_ctx)
     {
-         axis2_conf_ctx_free(worker_impl->conf_ctx, env);
-        worker_impl->conf_ctx = NULL;
+         axis2_conf_ctx_free(iis_worker->conf_ctx, env);
+        iis_worker->conf_ctx = NULL;
     }
 
-    if (iis_worker->ops)
-        AXIS2_FREE(env->allocator, iis_worker->ops);
-
-    AXIS2_FREE(env->allocator, worker_impl->conf_ctx);
+    AXIS2_FREE(env->allocator, iis_worker->conf_ctx);
 
     return;
 }
@@ -157,7 +107,6 @@
     const axutil_env_t *env,
     LPEXTENSION_CONTROL_BLOCK lpECB)
 {
-	axis2_iis_worker_impl_t *iis_worker_impl = NULL;
     axis2_conf_ctx_t *conf_ctx = NULL;
     axis2_msg_ctx_t *msg_ctx = NULL;
     axutil_stream_t *request_body = NULL;
@@ -200,8 +149,7 @@
         return HSE_STATUS_ERROR; 
     }
 
-	iis_worker_impl = AXIS2_INTF_TO_IMPL(iis_worker);
-	conf_ctx = iis_worker_impl->conf_ctx;	
+	conf_ctx = iis_worker->conf_ctx;	
 
 	if (! conf_ctx)
     {
@@ -230,10 +178,10 @@
     out_stream = axutil_stream_create_basic(env);	
  
     out_desc =  axis2_conf_get_transport_out( axis2_conf_ctx_get_conf
-            (iis_worker_impl->conf_ctx, env), env,
+            (iis_worker->conf_ctx, env), env,
             AXIS2_TRANSPORT_ENUM_HTTP);
     in_desc =  axis2_conf_get_transport_in( axis2_conf_ctx_get_conf
-            (iis_worker_impl->conf_ctx, env), env,
+            (iis_worker->conf_ctx, env), env,
             AXIS2_TRANSPORT_ENUM_HTTP);
 
 	msg_ctx = axis2_msg_ctx_create(env, conf_ctx, in_desc, out_desc);

Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/IIS/axis2_iis_worker.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/server/IIS/axis2_iis_worker.h?view=diff&rev=524529&r1=524528&r2=524529
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/IIS/axis2_iis_worker.h (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/IIS/axis2_iis_worker.h Sat Mar 31 21:57:54 2007
@@ -28,27 +28,16 @@
 {
 #endif
 
-typedef struct axis2_iis_worker_ops axis2_iis_worker_ops_t;
 typedef struct axis2_iis_worker axis2_iis_worker_t;
 	
-struct axis2_iis_worker_ops
-{
-    int (AXIS2_CALL *process_request)(
-                axis2_iis_worker_t *iis_worker,
-                const axutil_env_t *env, 
-                void *r);
-
-    axis2_status_t (AXIS2_CALL *free)(
-                axis2_iis_worker_t *iis_worker,
-                const axutil_env_t *env);
-};
-
-
-struct axis2_iis_worker
-{
-    axis2_iis_worker_ops_t *ops;
-};
-
+    int AXIS2_CALL
+    axis2_iis_worker_process_request(axis2_iis_worker_t *iis_worker,
+        const axutil_env_t *env, 
+        void *r);
+
+    axis2_status_t AXIS2_CALL
+    axis2_iis_worker_free(axis2_iis_worker_t *iis_worker,
+        const axutil_env_t *env);
 
 axis2_iis_worker_t * AXIS2_CALL
 axis2_iis_worker_create(
@@ -57,10 +46,10 @@
 
 
 #define AXIS2_IIS_WORKER_PROCESS_REQUEST(iis_worker, env, request)	\
-                        ((iis_worker)->ops->process_request(		\
-                        iis_worker, env, request))
+                        axis2_iis_worker_process_request(		\
+                        iis_worker, env, request)
 #define AXIS2_IIS_WORKER_FREE(iis_worker, env)					\
-                ((iis_worker)->ops->free(iis_worker, env))
+                axis2_iis_worker_free(iis_worker, env)
 
 #ifdef __cplusplus
 }

Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_worker.c?view=diff&rev=524529&r1=524528&r2=524529
==============================================================================
--- 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 Sat Mar 31 21:57:54 2007
@@ -34,103 +34,62 @@
 
 #define READ_SIZE  2048
 
-typedef struct axis2_apache2_worker_impl
+struct axis2_apache2_worker
 {
-    axis2_apache2_worker_t apache2_worker;
     axis2_conf_ctx_t *conf_ctx;
-}
-axis2_apache2_worker_impl_t;
-
-#define AXIS2_INTF_TO_IMPL(apache2_worker) ((axis2_apache2_worker_impl_t *)\
-                        (apache2_worker))
-
-int AXIS2_CALL
-axis2_apache2_worker_process_request(
-    axis2_apache2_worker_t *apache2_worker,
-    const axutil_env_t *env,
-    request_rec *req);
-
-AXIS2_EXTERN axis2_char_t *AXIS2_CALL
-axis2_apache2_worker_get_bytes(
-    const axutil_env_t *env,
-    axutil_stream_t *stream);
-
-void AXIS2_CALL
-axis2_apache2_worker_free(
-    axis2_apache2_worker_t *apache2_worker,
-    const axutil_env_t *env);
+};
 
 AXIS2_EXTERN axis2_apache2_worker_t *AXIS2_CALL
 axis2_apache2_worker_create(
     const axutil_env_t *env,
     axis2_char_t *repo_path)
 {
-    axis2_apache2_worker_impl_t *apache2_worker_impl = NULL;
+    axis2_apache2_worker_t *apache2_worker = NULL;
     AXIS2_ENV_CHECK(env, NULL);
-    apache2_worker_impl = (axis2_apache2_worker_impl_t *)
-            AXIS2_MALLOC(env->allocator, sizeof(axis2_apache2_worker_impl_t));
+    apache2_worker = (axis2_apache2_worker_t *)
+            AXIS2_MALLOC(env->allocator, sizeof(axis2_apache2_worker_t));
 
-    if (! apache2_worker_impl)
+    if (! apache2_worker)
     {
         AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
         return NULL;
     }
-    apache2_worker_impl->apache2_worker.ops = NULL;
-    apache2_worker_impl->conf_ctx = axis2_build_conf_ctx(env, repo_path);
+    apache2_worker->conf_ctx = axis2_build_conf_ctx(env, repo_path);
 
-    if (! apache2_worker_impl->conf_ctx)
+    if (! apache2_worker->conf_ctx)
     {
-        axis2_apache2_worker_free((axis2_apache2_worker_t *)apache2_worker_impl,
+        axis2_apache2_worker_free((axis2_apache2_worker_t *)apache2_worker,
                 env);
         return NULL;
     }
-    apache2_worker_impl->apache2_worker.ops = AXIS2_MALLOC(env->allocator,
-            sizeof(axis2_apache2_worker_ops_t));
-    if (! apache2_worker_impl->apache2_worker.ops)
-    {
-        axis2_apache2_worker_free((axis2_apache2_worker_t *)apache2_worker_impl,
-                env);
-        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
-        return NULL;
-    }
-
-    apache2_worker_impl->apache2_worker.ops->process_request =
-        axis2_apache2_worker_process_request;
-    apache2_worker_impl->apache2_worker.ops->free = axis2_apache2_worker_free;
-
-    return &(apache2_worker_impl->apache2_worker);
+    
+    return apache2_worker;
 }
 
-void AXIS2_CALL
+AXIS2_EXTERN void AXIS2_CALL
 axis2_apache2_worker_free(
     axis2_apache2_worker_t *apache2_worker,
     const axutil_env_t *env)
 {
-    axis2_apache2_worker_impl_t *worker_impl = NULL;
     AXIS2_ENV_CHECK(env, void);
 
-    worker_impl = AXIS2_INTF_TO_IMPL(apache2_worker);
-    if (worker_impl->conf_ctx)
+    if (apache2_worker->conf_ctx)
     {
-         axis2_conf_ctx_free(worker_impl->conf_ctx, env);
-        worker_impl->conf_ctx = NULL;
+         axis2_conf_ctx_free(apache2_worker->conf_ctx, env);
+        apache2_worker->conf_ctx = NULL;
     }
 
-    if (apache2_worker->ops)
-        AXIS2_FREE(env->allocator, apache2_worker->ops);
-
-    AXIS2_FREE(env->allocator, worker_impl->conf_ctx);
+    AXIS2_FREE(env->allocator, apache2_worker->conf_ctx);
 
     return;
 }
 
-int AXIS2_CALL
+AXIS2_EXTERN int AXIS2_CALL
 axis2_apache2_worker_process_request(
     axis2_apache2_worker_t *apache2_worker,
     const axutil_env_t *env,
     request_rec *request)
 {
-    axis2_apache2_worker_impl_t *apache2_worker_impl = NULL;
     axis2_conf_ctx_t *conf_ctx = NULL;
     axis2_msg_ctx_t *msg_ctx = NULL;
     axutil_stream_t *request_body = NULL;
@@ -153,8 +112,7 @@
     AXIS2_ENV_CHECK(env, AXIS2_CRITICAL_FAILURE);
     AXIS2_PARAM_CHECK(env->error, request, AXIS2_CRITICAL_FAILURE);
 
-    apache2_worker_impl = AXIS2_INTF_TO_IMPL(apache2_worker);
-    conf_ctx = apache2_worker_impl->conf_ctx;
+    conf_ctx = apache2_worker->conf_ctx;
 
     if (! conf_ctx)
     {
@@ -187,10 +145,10 @@
     encoding_header_value = (axis2_char_t*)request->content_encoding;
 
     out_desc =  axis2_conf_get_transport_out( axis2_conf_ctx_get_conf
-            (apache2_worker_impl->conf_ctx, env), env,
+            (apache2_worker->conf_ctx, env), env,
             AXIS2_TRANSPORT_ENUM_HTTP);
     in_desc =  axis2_conf_get_transport_in( axis2_conf_ctx_get_conf
-            (apache2_worker_impl->conf_ctx, env), env,
+            (apache2_worker->conf_ctx, env), env,
             AXIS2_TRANSPORT_ENUM_HTTP);
 
     msg_ctx = axis2_msg_ctx_create(env, conf_ctx, in_desc, out_desc);

Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/axis2_apache2_worker.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/axis2_apache2_worker.h?view=diff&rev=524529&r1=524528&r2=524529
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/axis2_apache2_worker.h (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/axis2_apache2_worker.h Sat Mar 31 21:57:54 2007
@@ -46,47 +46,27 @@
 #endif
 
 
-    typedef struct axis2_apache2_worker_ops axis2_apache2_worker_ops_t;
     typedef struct axis2_apache2_worker axis2_apache2_worker_t;
 
+    AXIS2_EXTERN int AXIS2_CALL
+    axis2_apache2_worker_process_request(axis2_apache2_worker_t *apache2_worker,
+        const axutil_env_t *env, 
+        request_rec *r);
 
-    struct axis2_apache2_worker_ops
-    {
-        int (AXIS2_CALL *
-                process_request)(
-                    axis2_apache2_worker_t *apache2_worker,
-                    const axutil_env_t *env, 
-                    request_rec *r);
-
-        void (AXIS2_CALL *
-                free)(
-                    axis2_apache2_worker_t *apache2_worker,
-                    const axutil_env_t *env);
-    };
-
-    /**
-     * @brief Apache2 Worker struct
-      *    Axis2 Apache2 Worker
-     */
-    struct axis2_apache2_worker
-    {
-        axis2_apache2_worker_ops_t *ops;
-    };
-
+    AXIS2_EXTERN void AXIS2_CALL
+    axis2_apache2_worker_free(axis2_apache2_worker_t *apache2_worker,
+        const axutil_env_t *env);
 
     AXIS2_EXTERN axis2_apache2_worker_t * AXIS2_CALL
     axis2_apache2_worker_create(
         const axutil_env_t *env, 
         axis2_char_t *repo_path);
 
-/************************** Start of function macros **************************/
 #define AXIS2_APACHE2_WORKER_PROCESS_REQUEST(apache2_worker, env, request) \
-                        ((apache2_worker)->ops->process_request(\
-                        apache2_worker, env, request))
+                        axis2_apache2_worker_process_request(\
+                        apache2_worker, env, request)
 #define AXIS2_APACHE2_WORKER_FREE(apache2_worker, env) \
-                ((apache2_worker)->ops->free(apache2_worker, env))
-
-/************************** End of function macros ****************************/
+                axis2_apache2_worker_free(apache2_worker, env)
 
 /** @} */
 #ifdef __cplusplus



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