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 du...@apache.org on 2008/01/24 13:01:08 UTC
svn commit: r614856 - in /webservices/axis2/trunk/c/src/core/transport/http:
common/http_worker.c common/simple_http_svr_conn.c sender/http_sender.c
sender/libcurl/axis2_libcurl.c server/IIS/axis2_iis_worker.c
Author: dushshantha
Date: Thu Jan 24 04:01:06 2008
New Revision: 614856
URL: http://svn.apache.org/viewvc?rev=614856&view=rev
Log:
applied the patch for AXIS2C-929
Modified:
webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c
webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c
webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c
webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/axis2_libcurl.c
webservices/axis2/trunk/c/src/core/transport/http/server/IIS/axis2_iis_worker.c
Modified: webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c?rev=614856&r1=614855&r2=614856&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/common/http_worker.c Thu Jan 24 04:01:06 2008
@@ -125,6 +125,8 @@
axis2_char_t *svc_grp_uuid = NULL;
axis2_char_t *path = NULL;
axutil_property_t *peer_property = NULL;
+ axis2_bool_t is_get = AXIS2_FALSE;
+ axis2_bool_t is_head = AXIS2_FALSE;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, svr_conn, AXIS2_FAILURE);
@@ -251,10 +253,21 @@
(simple_request, env, AXIS2_HTTP_HEADER_SOAP_ACTION), env);
soap_action_str = axutil_string_create(env, soap_action);
}
- if (0 ==
+ if ((0 ==
axutil_strcasecmp(axis2_http_request_line_get_method
(axis2_http_simple_request_get_request_line
- (simple_request, env), env), AXIS2_HTTP_GET))
+ (simple_request, env), env), AXIS2_HTTP_GET)))
+ {
+ is_get = AXIS2_TRUE;
+ }
+ else if ((0 ==
+ axutil_strcasecmp(axis2_http_request_line_get_method
+ (axis2_http_simple_request_get_request_line
+ (simple_request, env), env), AXIS2_HTTP_HEAD)))
+ {
+ is_head = AXIS2_TRUE;
+ }
+ if (is_get || is_head)
{
processed = axis2_http_transport_utils_process_http_get_request
(env, msg_ctx, request_body, out_stream,
@@ -421,7 +434,10 @@
axis2_http_simple_response_set_status_line(response, env, http_version,
AXIS2_HTTP_RESPONSE_OK_CODE_VAL,
"OK");
- axis2_http_simple_response_set_body_stream(response, env, out_stream);
+ if (!is_head)
+ {
+ axis2_http_simple_response_set_body_stream(response, env, out_stream);
+ }
}
else
{
Modified: webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c?rev=614856&r1=614855&r2=614856&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/common/simple_http_svr_conn.c Thu Jan 24 04:01:06 2008
@@ -196,7 +196,8 @@
if (strlen(str_line))
{
if (0 != axutil_strncasecmp(str_line, "GET", 3) && 0 !=
- axutil_strncasecmp(str_line, "POST", 4))
+ axutil_strncasecmp(str_line, "POST", 4) && 0 !=
+ axutil_strncasecmp(str_line, "HEAD", 4))
{
char write_buf[512];
sprintf(write_buf, "%s %s\r\n%s: close\r\n\r\n",
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=614856&r1=614855&r2=614856&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 Thu Jan 24 04:01:06 2008
@@ -219,6 +219,7 @@
axutil_property_t *method = NULL;
axis2_char_t *method_value = NULL;
axis2_bool_t send_via_get = AXIS2_FALSE;
+ axis2_bool_t send_via_head = AXIS2_FALSE;
axiom_node_t *data_out = NULL;
axiom_node_t *body_node = NULL;
axiom_soap_body_t *soap_body = NULL;
@@ -278,6 +279,10 @@
{
send_via_get = AXIS2_TRUE;
}
+ if (method_value && 0 == axutil_strcmp (method_value, AXIS2_HTTP_HEAD))
+ {
+ send_via_head = AXIS2_TRUE;
+ }
}
if (!url)
@@ -303,8 +308,11 @@
*/
axis2_http_sender_configure_proxy (sender, env, msg_ctx);
-
- conf_ctx = axis2_msg_ctx_get_conf_ctx (msg_ctx, env);
+
+ if (send_via_head)
+ {
+ conf_ctx = axis2_msg_ctx_get_conf_ctx (msg_ctx, env);
+ }
if (conf_ctx)
{
conf = axis2_conf_ctx_get_conf (conf_ctx, env);
@@ -352,8 +360,7 @@
{
axiom_output_write_xml_version_encoding (sender->om_output, env);
}
-
- if (!send_via_get)
+ if (!send_via_get && !send_via_head)
{
axutil_property_t *property = NULL;
@@ -447,9 +454,12 @@
path = axutil_strcat (env,
axutil_url_get_path (url, env),
"?", request_params, NULL);
-
- request_line = axis2_http_request_line_create (env, "GET", path,
- sender->http_version);
+ if (send_via_get)
+ request_line = axis2_http_request_line_create (env, "GET", path,
+ sender->http_version);
+ if (send_via_head)
+ request_line = axis2_http_request_line_create (env, "HEAD", path,
+ sender->http_version);
}
request = axis2_http_simple_request_create (env, request_line, NULL, 0,
@@ -495,7 +505,7 @@
}
}
- if (!send_via_get)
+ if (!send_via_get && !send_via_head)
{
buffer_size = axiom_xml_writer_get_xml_size (xml_writer, env);
Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/axis2_libcurl.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/axis2_libcurl.c?rev=614856&r1=614855&r2=614856&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/axis2_libcurl.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/libcurl/axis2_libcurl.c Thu Jan 24 04:01:06 2008
@@ -88,6 +88,7 @@
axiom_soap_body_t *soap_body;
axis2_bool_t is_soap = AXIS2_TRUE;
axis2_bool_t send_via_get = AXIS2_FALSE;
+ axis2_bool_t send_via_head = AXIS2_FALSE;
axis2_bool_t doing_mtom = AXIS2_FALSE;
axiom_node_t *body_node = NULL;
axiom_node_t *data_out = NULL;
@@ -177,6 +178,10 @@
{
send_via_get = AXIS2_TRUE;
}
+ if (method_value && 0 == axutil_strcmp(method_value, AXIS2_HTTP_HEAD))
+ {
+ send_via_head = AXIS2_TRUE;
+ }
}
conf_ctx = axis2_msg_ctx_get_conf_ctx (msg_ctx, env);
@@ -407,7 +412,14 @@
(axis2_char_t *) axis2_http_sender_get_param_string(NULL, env,
msg_ctx);
url_encode = axutil_strcat(env, str_url, "?", request_param, NULL);
- curl_easy_setopt(handler, CURLOPT_HTTPGET, 1);
+ if (send_via_get)
+ {
+ curl_easy_setopt(handler, CURLOPT_HTTPGET, 1);
+ }
+ if (send_via_head)
+ {
+ curl_easy_setopt(handler, CURLOPT_NOBODY, 1);
+ }
curl_easy_setopt(handler, CURLOPT_URL, url_encode);
}
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=614856&r1=614855&r2=614856&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 Thu Jan 24 04:01:06 2008
@@ -264,7 +264,7 @@
return HSE_STATUS_ERROR;
}
-if (stricmp(lpECB->lpszMethod, "GET") == 0)
+if (stricmp(lpECB->lpszMethod, "GET") == 0 || stricmp(lpECB->lpszMethod, "HEAD") == 0)
{
processed = axis2_http_transport_utils_process_http_get_request
(env, msg_ctx, request_body, out_stream, lpECB->lpszContentType,
@@ -446,7 +446,8 @@
}
-
+if (stricmp(lpECB->lpszMethod, "HEAD") != 0)
+{
if (!write_response(lpECB, body_string, body_str_len))
{
@@ -455,6 +456,7 @@
" writing response.");
}
+}
AXIS2_FREE(env->allocator, body_string);
@@ -813,6 +815,7 @@
return buffer;
}
+
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org