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 di...@apache.org on 2008/03/26 06:34:05 UTC
svn commit: r641158 - in /webservices/axis2/trunk/c:
include/axis2_http_transport.h
src/core/transport/http/receiver/http_receiver.c
src/core/transport/http/sender/http_client.c
src/core/transport/http/sender/http_sender.c
Author: dinesh
Date: Tue Mar 25 22:34:05 2008
New Revision: 641158
URL: http://svn.apache.org/viewvc?rev=641158&view=rev
Log:
code improvement to http_receiver and more detailed log messages
Modified:
webservices/axis2/trunk/c/include/axis2_http_transport.h
webservices/axis2/trunk/c/src/core/transport/http/receiver/http_receiver.c
webservices/axis2/trunk/c/src/core/transport/http/sender/http_client.c
webservices/axis2/trunk/c/src/core/transport/http/sender/http_sender.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=641158&r1=641157&r2=641158&view=diff
==============================================================================
--- webservices/axis2/trunk/c/include/axis2_http_transport.h (original)
+++ webservices/axis2/trunk/c/include/axis2_http_transport.h Tue Mar 25 22:34:05 2008
@@ -981,6 +981,13 @@
#define AXIS2_CONTENT_TYPE_CHARSET ";charset="
+#define AXIS2_PORT_STRING "port"
+
+#define AXIS2_DEFAULT_HOST_ADDRESS "127.0.0.1"
+
+#define AXIS2_DEFAULT_SVC_PATH "/axis2/services/"
+
+#define AXIS2_HTTP_PROTOCOL "http"
/** @} */
#ifdef __cplusplus
Modified: webservices/axis2/trunk/c/src/core/transport/http/receiver/http_receiver.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/receiver/http_receiver.c?rev=641158&r1=641157&r2=641158&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/receiver/http_receiver.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/receiver/http_receiver.c Tue Mar 25 22:34:05 2008
@@ -95,7 +95,6 @@
const int port)
{
axis2_http_server_impl_t *server_impl = NULL;
- AXIS2_ENV_CHECK(env, NULL);
server_impl = (axis2_http_server_impl_t *) AXIS2_MALLOC
(env->allocator, sizeof(axis2_http_server_impl_t));
@@ -125,6 +124,9 @@
server_impl->conf_ctx_private = axis2_build_conf_ctx(env, repo);
if (!server_impl->conf_ctx_private)
{
+ AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
+ "unable to create private configuration context\
+for repo path %s", repo);
axis2_http_server_free((axis2_transport_receiver_t *) server_impl,
env);
return NULL;
@@ -143,13 +145,13 @@
const int port)
{
axis2_http_server_impl_t *server_impl = NULL;
- AXIS2_ENV_CHECK(env, NULL);
+
server_impl = (axis2_http_server_impl_t *) AXIS2_MALLOC
(env->allocator, sizeof(axis2_http_server_impl_t));
if (!server_impl)
{
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ AXIS2_HANDLE_ERROR(env, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
}
@@ -176,6 +178,8 @@
{
axis2_http_server_free((axis2_transport_receiver_t *) server_impl,
env);
+ AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "unable to create\
+configuration context for file %s", file);
return NULL;
}
server_impl->conf_ctx = server_impl->conf_ctx_private;
@@ -191,7 +195,14 @@
const axutil_env_t * env)
{
axis2_http_server_impl_t *server_impl = NULL;
- AXIS2_ENV_CHECK(env, void);
+
+ if (!server)
+ {
+ AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
+ "failure, server value is null , nothing to free");
+ return;
+ }
+
server_impl = AXIS2_INTF_TO_IMPL(server);
if (server_impl->svr_thread)
{
@@ -227,18 +238,22 @@
axis2_char_t *port_str = NULL;
axutil_param_t *param = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK (env->error, server, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK (env->error, conf_ctx, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK (env->error, in_desc, AXIS2_FAILURE);
+
server_impl = AXIS2_INTF_TO_IMPL(server);
server_impl->conf_ctx = conf_ctx;
param =
(axutil_param_t *)
axutil_param_container_get_param(axis2_transport_in_desc_param_container
- (in_desc, env), env, "port");
+ (in_desc, env), env, AXIS2_PORT_STRING);
if (param)
{
port_str = axutil_param_get_value(param, env);
}
+
if (port_str)
{
server_impl->port = atoi(port_str);
@@ -254,22 +269,31 @@
axis2_http_server_impl_t *server_impl = NULL;
axis2_http_worker_t *worker = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ AXIS2_PARAM_CHECK (env->error, server, AXIS2_FAILURE);
server_impl = AXIS2_INTF_TO_IMPL(server);
server_impl->svr_thread = axis2_http_svr_thread_create(env,
server_impl->port);
if (!server_impl->svr_thread)
{
+ AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
+ "unable to create server thread for port %d",
+ server_impl->port);
+
return AXIS2_FAILURE;
}
+
worker = axis2_http_worker_create(env, server_impl->conf_ctx);
- axis2_http_worker_set_svr_port(worker, env, server_impl->port);
if (!worker)
{
+ AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI,
+ "axis2 http worker creation failed");
+
axis2_http_svr_thread_free(server_impl->svr_thread, env);
return AXIS2_FAILURE;
}
+ axis2_http_worker_set_svr_port(worker, env, server_impl->port);
AXIS2_LOG_INFO(env->log, "Starting HTTP server thread");
axis2_http_svr_thread_set_worker(server_impl->svr_thread, env, worker);
axis2_http_svr_thread_run(server_impl->svr_thread, env);
@@ -281,8 +305,8 @@
axis2_transport_receiver_t * server,
const axutil_env_t * env)
{
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK (env->error, server, AXIS2_FAILURE);
AXIS2_LOG_INFO(env->log, "Terminating HTTP server thread");
if (AXIS2_INTF_TO_IMPL(server)->svr_thread)
{
@@ -298,7 +322,7 @@
axis2_transport_receiver_t * server,
const axutil_env_t * env)
{
- AXIS2_ENV_CHECK(env, NULL);
+ AXIS2_PARAM_CHECK (env->error, server, NULL);
return AXIS2_INTF_TO_IMPL(server)->conf_ctx;
}
@@ -312,12 +336,13 @@
const axis2_char_t *host_address = NULL;
axis2_char_t *svc_path = NULL;
axutil_url_t *url = NULL;
- AXIS2_ENV_CHECK(env, NULL);
+
AXIS2_PARAM_CHECK(env->error, svc_name, NULL);
+ AXIS2_PARAM_CHECK(env->error, server, NULL);
- host_address = "127.0.0.1"; /* TODO : get from axis2.xml */
- svc_path = axutil_stracat(env, "/axis2/services/", svc_name);
- url = axutil_url_create(env, "http", host_address,
+ host_address = AXIS2_DEFAULT_HOST_ADDRESS; /* TODO : get from axis2.xml */
+ svc_path = axutil_stracat(env, AXIS2_DEFAULT_SVC_PATH, svc_name);
+ url = axutil_url_create(env, AXIS2_HTTP_PROTOCOL, host_address,
AXIS2_INTF_TO_IMPL(server)->port, svc_path);
AXIS2_FREE(env->allocator, svc_path);
if (!url)
@@ -336,7 +361,7 @@
const axutil_env_t * env)
{
axis2_http_server_impl_t *server_impl = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK (env->error, server, AXIS2_FALSE);
server_impl = AXIS2_INTF_TO_IMPL(server);
if (server_impl->svr_thread)
{
Modified: webservices/axis2/trunk/c/src/core/transport/http/sender/http_client.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/src/core/transport/http/sender/http_client.c?rev=641158&r1=641157&r2=641158&view=diff
==============================================================================
--- webservices/axis2/trunk/c/src/core/transport/http/sender/http_client.c (original)
+++ webservices/axis2/trunk/c/src/core/transport/http/sender/http_client.c Tue Mar 25 22:34:05 2008
@@ -73,6 +73,7 @@
http_client->sockfd = -1;
http_client->response = NULL;
http_client->request_sent = AXIS2_FALSE;
+
/* default timeout is 60000 milliseconds */
http_client->timeout = AXIS2_HTTP_DEFAULT_CONNECTION_TIMEOUT;
http_client->proxy_enabled = AXIS2_FALSE;
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=641158&r1=641157&r2=641158&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 22:34:05 2008
@@ -1499,6 +1499,7 @@
env, MTOM_RECIVED_CONTENT_TYPE, property);
}
}
+
if (charset)
{
axis2_ctx_t *axis_ctx =
@@ -1512,6 +1513,8 @@
property);
}
}
+
+
if (AXIS2_FALSE == response_chunked)
{
int tmp_len = 0;
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org