You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2008/03/25 10:03:12 UTC

svn commit: r640749 - in /webservices/axis2/trunk/c: include/axis2_http_transport.h src/core/engine/rest_disp.c src/core/transport/http/sender/http_sender.c src/core/transport/http/server/apache2/mod_axis2.c

Author: dinesh
Date: Tue Mar 25 02:03:07 2008
New Revision: 640749

URL: http://svn.apache.org/viewvc?rev=640749&view=rev
Log:
1. fixed echo_rest segmentation fault.
2. fixed fomatting and logs in http_sender.c


Modified:
    webservices/axis2/trunk/c/include/axis2_http_transport.h
    webservices/axis2/trunk/c/src/core/engine/rest_disp.c
    webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c
    webservices/axis2/trunk/c/src/core/transport/http/server/apache2/mod_axis2.c

Modified: webservices/axis2/trunk/c/include/axis2_http_transport.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/include/axis2_http_transport.h?rev=640749&r1=640748&r2=640749&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_transport.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_transport.h Tue Mar 25 02:03:07 2008
@@ -579,7 +579,7 @@
     /**
      * HEADER_USER_AGENT_AXIS2C
      */
-#define AXIS2_HTTP_HEADER_USER_AGENT_AXIS2C "User-Agent: Axis2/C " AXIS2_VERSION_STRING
+#define AXIS2_HTTP_HEADER_USER_AGENT_AXIS2C "User-Agent: Axis2C/" AXIS2_VERSION_STRING
 
     /**
      * HEADER_SERVER
@@ -594,7 +594,7 @@
     /**
      * HEADER_SERVER_AXIS2C
      */
-#define AXIS2_HTTP_HEADER_SERVER_AXIS2C "Server: Axis2/C " AXIS2_VERSION_STRING
+#define AXIS2_HTTP_HEADER_SERVER_AXIS2C "Axis2C/" AXIS2_VERSION_STRING
 
 #define AXIS2_HTTP_HEADER_ACCEPT_ "Accept: "
 
@@ -967,7 +967,7 @@
 
 #define AXIS2_Q_MARK "?"
 
-#define AXIS2_USER_AGENT "Axis2/C " AXIS2_VERSION_STRING
+#define AXIS2_USER_AGENT "Axis2C/" AXIS2_VERSION_STRING
 
 #define AXIS2_AND_SIGN "&"
 

Modified: webservices/axis2/trunk/c/src/core/engine/rest_disp.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/engine/rest_disp.c?rev=640749&r1=640748&r2=640749&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/engine/rest_disp.c (original)
+++ webservices/axis2/trunk/c/src/core/engine/rest_disp.c Tue Mar 25 02:03:07 2008
@@ -205,7 +205,7 @@
                         location += strlen(url_tokens[0]);
                         AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI,
                                         "Checking for operation using \
-                                 REST HTTP Location fragment : %s", location);
+REST HTTP Location fragment : %s", location);
                         op = axis2_rest_disp_get_rest_op_with_method_and_location(svc, env,
                                  axis2_msg_ctx_get_rest_http_method(msg_ctx, env), location,
                                  &param_count, &params);
@@ -219,13 +219,23 @@
                             int i = 0;
                             int j = 0;
                             axutil_array_list_t *supported_rest_methods = NULL;
+                            const axis2_char_t *http_method = NULL;
                             axis2_char_t *rest_methods[] = {AXIS2_HTTP_GET, AXIS2_HTTP_POST,
                                 AXIS2_HTTP_PUT, AXIS2_HTTP_DELETE, AXIS2_HTTP_HEAD};
                             supported_rest_methods = axutil_array_list_create(env, 0);
+                            http_method = axis2_msg_ctx_get_rest_http_method(msg_ctx, env);
+                            if (!http_method)
+                            {
+                                AXIS2_LOG_WARNING (env->log, AXIS2_LOG_SI,
+                                                 "unable to find http method \
+for location: %s", location);
+                                return NULL;
+                            }
+
                             for (i = 0; i < 5; i++)
                             {
-                                if (axutil_strcasecmp(rest_methods[i],
-                                    axis2_msg_ctx_get_rest_http_method(msg_ctx, env)))
+                                if (axutil_strcasecmp(rest_methods[i], 
+                                                      http_method))
                                 {
                                     if (axis2_rest_disp_get_rest_op_with_method_and_location(svc, env,
                                         rest_methods[i], location, &param_count, &params))

Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c?rev=640749&r1=640748&r2=640749&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c Tue Mar 25 02:03:07 2008
@@ -807,6 +807,8 @@
                                                    env, buffer, buffer_size);
     }
     
+
+    /* HTTPS request processing */
     axis2_http_sender_configure_server_cert (sender, env, msg_ctx);
 
     axis2_http_sender_configure_key_file (sender, env, msg_ctx);
@@ -899,9 +901,11 @@
     }
 
     if (proxy_auth_property)
+    {
         proxy_auth_property_value = (axis2_char_t *) 
             axutil_property_get_value (proxy_auth_property,
                                        env);
+    }
 
     if (proxy_auth_property_value && 
         0 == axutil_strcmp (proxy_auth_property_value, 
@@ -960,10 +964,12 @@
 
     if (force_proxy_auth || force_proxy_auth_with_head)
     {
-        status_code = AXIS2_HTTP_RESPONSE_PROXY_AUTHENTICATION_REQUIRED_CODE_VAL;
+        status_code = 
+            AXIS2_HTTP_RESPONSE_PROXY_AUTHENTICATION_REQUIRED_CODE_VAL;
     }
     else
     {
+        /* NOT forcing proxy authentication  */
         if (force_http_auth)
         {
             axis2_status_t auth_status;
@@ -978,7 +984,7 @@
                                  "Error in setting HTTP Authentication header");
             }
             http_auth_header_added = AXIS2_TRUE;
-            /* how should this status_code be handled? */
+
             status_code = axis2_http_client_send (sender->client, 
                                                   env, request, ssl_pp);
 
@@ -1028,7 +1034,7 @@
             if (status_code != 
                 AXIS2_HTTP_RESPONSE_PROXY_AUTHENTICATION_REQUIRED_CODE_VAL)
             {
-                /* how should this status_code be handled? */
+
                 status_code = axis2_http_client_send (sender->client, env, 
                                                       request, ssl_pp);
 
@@ -1045,7 +1051,6 @@
         }
         else 
         {
-            /* how should this status_code be handled? */
             status_code = axis2_http_client_send (sender->client, env, 
                                                   request, ssl_pp);
 
@@ -1104,7 +1109,6 @@
                 }
                 else
                 {
-                    /* how should this status_code be handled? */
                     status_code = axis2_http_client_send (sender->client, env, 
                                                           request, ssl_pp);
 
@@ -1122,6 +1126,7 @@
                 status_code = axis2_http_client_recieve_header (sender->client,
                                                                 env);
             }
+
             /* Proxies have no idea about HTTP Methods therefore, if
              * it fails no need to re-check */ 
             if (AXIS2_HTTP_RESPONSE_PROXY_AUTHENTICATION_REQUIRED_CODE_VAL == 
@@ -1136,6 +1141,8 @@
         }
         else
         {
+
+            /* not forcing proxy auth with head */
             axis2_status_t auth_status;
             auth_status = axis2_http_sender_configure_proxy_auth (sender,
                                                                   env,
@@ -1330,6 +1337,7 @@
 
     axis2_msg_ctx_set_status_code (msg_ctx, env, status_code);
 
+    /* Start processing response */
     response = axis2_http_client_get_response (sender->client, env);
     if (!is_soap)
     {
@@ -1572,8 +1580,8 @@
     axutil_param_t *tmp_param = NULL;
     axutil_property_t *property = NULL;
 
-    AXIS2_ENV_CHECK (env, AXIS2_FAILURE);
-
+    AXIS2_PARAM_CHECK (env->error, sender, AXIS2_FAILURE);
+    AXIS2_PARAM_CHECK (env->error, msg_ctx, AXIS2_FAILURE);
     /* check if timeout has been set by user using options 
      * with axis2_options_set_timeout_in_milli_seconds
      */
@@ -1622,7 +1630,6 @@
                                     const axutil_env_t * env,
                                     axis2_char_t * version)
 {
-    AXIS2_ENV_CHECK (env, AXIS2_FAILURE);
     sender->http_version = axutil_strdup (env, version);
     if (!sender->http_version)
     {
@@ -1662,7 +1669,6 @@
     axis2_char_t *proxy_host = NULL;
     axis2_char_t *proxy_port = NULL;
 
-    AXIS2_ENV_CHECK (env, AXIS2_FAILURE);
     AXIS2_PARAM_CHECK (env->error, msg_ctx, AXIS2_FAILURE);
 
     conf_ctx = axis2_msg_ctx_get_conf_ctx (msg_ctx, env);
@@ -3214,7 +3220,6 @@
     axis2_char_t *param_string = NULL;
     int i = 0;
 
-    AXIS2_ENV_CHECK (env, NULL);
     AXIS2_PARAM_CHECK (env->error, msg_ctx, NULL);
 
     soap_env = axis2_msg_ctx_get_soap_envelope (msg_ctx, env);

Modified: webservices/axis2/trunk/c/src/core/transport/http/server/apache2/mod_axis2.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/server/apache2/mod_axis2.c?rev=640749&r1=640748&r2=640749&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/server/apache2/mod_axis2.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/server/apache2/mod_axis2.c Tue Mar 25 02:03:07 2008
@@ -443,7 +443,7 @@
 	 * going through all of the initialization on the first call
 	 * because it will just be thrown away.*/
     
-    ap_add_version_component(pconf, "Axis2C/" AXIS2_VERSION_STRING);
+    ap_add_version_component(pconf, AXIS2_HTTP_HEADER_SERVER_AXIS2C);
 
 	apr_pool_userdata_get(&data, userdata_key, svr_rec->process->pool);
 	if (!data) 



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