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 2008/02/23 04:21:56 UTC
svn commit: r630384 - in /webservices/axis2/trunk/c/src/core:
clientapi/options.c transport/http/sender/http_sender.c
Author: samisa
Date: Fri Feb 22 19:21:56 2008
New Revision: 630384
URL: http://svn.apache.org/viewvc?rev=630384&view=rev
Log:
Fixed picking timeout set by the user. User sets timeout with axis2_options_set_timeout_in_milli_seconds and http sender/http_sender.c picks it as a property
Modified:
webservices/axis2/trunk/c/src/core/clientapi/options.c
webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.c
Modified: webservices/axis2/trunk/c/src/core/clientapi/options.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/clientapi/options.c?rev=630384&r1=630383&r2=630384&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/clientapi/options.c (original)
+++ webservices/axis2/trunk/c/src/core/clientapi/options.c Fri Feb 22 19:21:56 2008
@@ -625,8 +625,23 @@
axis2_options_t * options,
const axutil_env_t * env,
const long timeout_in_milli_seconds)
-{
+{
options->timeout_in_milli_seconds = timeout_in_milli_seconds;
+ // set the property AXIS2_HTTP_CONNECTION_TIMEOUT, to be picked up by http_sender
+ if (options->timeout_in_milli_seconds > 0)
+ {
+ axis2_char_t time_str[19]; // supports 18 digit timeout
+ axutil_property_t *property = axutil_property_create(env);
+ sprintf(time_str, "%ld", options->timeout_in_milli_seconds);
+ if (property)
+ {
+ axutil_property_set_scope(property, env, AXIS2_SCOPE_REQUEST);
+ axutil_property_set_value(property, env,
+ axutil_strdup(env, time_str));
+ axis2_options_set_property(options, env, AXIS2_HTTP_CONNECTION_TIMEOUT,
+ property);
+ }
+ }
return AXIS2_SUCCESS;
}
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=630384&r1=630383&r2=630384&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 Fri Feb 22 19:21:56 2008
@@ -1356,9 +1356,24 @@
axis2_char_t *so_str = NULL;
axis2_char_t *connection_str = NULL;
axutil_param_t *tmp_param = NULL;
+ axutil_property_t *property = NULL;
AXIS2_ENV_CHECK (env, AXIS2_FAILURE);
+ // ckeck if timeout has been set by user using options
+ // with axis2_options_set_timeout_in_milli_seconds
+ property =
+ axis2_msg_ctx_get_property(msg_ctx, env, AXIS2_HTTP_CONNECTION_TIMEOUT);
+ if (property)
+ {
+ axis2_char_t *value = axutil_property_get_value(property, env);
+ if (value)
+ {
+ sender->so_timeout = AXIS2_ATOI(value);
+ return AXIS2_SUCCESS;
+ }
+ }
+
tmp_param = axis2_msg_ctx_get_parameter (msg_ctx,
env, AXIS2_HTTP_SO_TIMEOUT);
@@ -1367,9 +1382,11 @@
so_str = (axis2_char_t *) axutil_param_get_value (tmp_param, env);
if (so_str)
{
- sender->so_timeout = AXIS2_ATOI (so_str);
+ sender->so_timeout = AXIS2_ATOI (so_str);
+ return AXIS2_SUCCESS;
}
}
+
tmp_param = axis2_msg_ctx_get_parameter (msg_ctx, env,
AXIS2_HTTP_CONNECTION_TIMEOUT);
if (tmp_param)
@@ -1378,10 +1395,11 @@
(axis2_char_t *) axutil_param_get_value (tmp_param, env);
if (connection_str)
{
- sender->connection_timeout = AXIS2_ATOI (connection_str);
+ sender->so_timeout = AXIS2_ATOI (connection_str);
+ return AXIS2_SUCCESS;
}
}
- return AXIS2_SUCCESS;
+ return AXIS2_FAILURE;
}
AXIS2_EXTERN axis2_status_t AXIS2_CALL
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org