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 sa...@apache.org on 2006/06/04 05:09:41 UTC
svn commit: r411506 [15/27] - in /webservices/axis2/trunk/c: axiom/include/
axiom/src/attachments/ axiom/src/om/ axiom/src/parser/guththila/
axiom/src/parser/libxml2/ axiom/src/soap/ axiom/test/om/ axiom/test/soap/
guththila/src/ include/ modules/core/...
Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c?rev=411506&r1=411505&r2=411506&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/sender/soap_over_http_sender.c Sat Jun 3 20:09:08 2006
@@ -29,75 +29,75 @@
/**
* @brief SOAP over HTTP sender struct impl
- * Axis2 SOAP over HTTP sender impl
+ * Axis2 SOAP over HTTP sender impl
*/
typedef struct axis2_soap_over_http_sender_impl
- axis2_soap_over_http_sender_impl_t;
+ axis2_soap_over_http_sender_impl_t;
struct axis2_soap_over_http_sender_impl
{
- axis2_soap_over_http_sender_t sender;
- axis2_char_t *http_version;
- axis2_bool_t chunked;
- int so_timeout;
- int connection_timeout;
- axis2_om_output_t *om_output;
- axis2_http_client_t *client;
+ axis2_soap_over_http_sender_t sender;
+ axis2_char_t *http_version;
+ axis2_bool_t chunked;
+ int so_timeout;
+ int connection_timeout;
+ axis2_om_output_t *om_output;
+ axis2_http_client_t *client;
};
#define AXIS2_INTF_TO_IMPL(sender) \
- ((axis2_soap_over_http_sender_impl_t *)(sender))
+ ((axis2_soap_over_http_sender_impl_t *)(sender))
/***************************** Function headers *******************************/
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_get_header_info
- (axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx,
- axis2_http_simple_response_t *response);
+ (axis2_soap_over_http_sender_t *sender,
+ const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx,
+ axis2_http_simple_response_t *response);
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_process_response
- (axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx,
- axis2_http_simple_response_t *response);
+ (axis2_soap_over_http_sender_t *sender,
+ const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx,
+ axis2_http_simple_response_t *response);
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_get_timeout_values
- (axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx);
+ (axis2_soap_over_http_sender_t *sender,
+ const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx);
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_send
- (axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx,
- axis2_soap_envelope_t *out, axis2_char_t *str_url,
- axis2_char_t *soap_action);
+ (axis2_soap_over_http_sender_t *sender,
+ const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx,
+ axis2_soap_envelope_t *out, axis2_char_t *str_url,
+ axis2_char_t *soap_action);
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_set_chunked
- (axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env, axis2_bool_t chunked);
+ (axis2_soap_over_http_sender_t *sender,
+ const axis2_env_t *env, axis2_bool_t chunked);
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_set_om_output
- (axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env, axis2_om_output_t *om_output);
-
+ (axis2_soap_over_http_sender_t *sender,
+ const axis2_env_t *env, axis2_om_output_t *om_output);
+
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_set_http_version
- (axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env, axis2_char_t *version);
+ (axis2_soap_over_http_sender_t *sender,
+ const axis2_env_t *env, axis2_char_t *version);
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_configure_proxy(
axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env,
+ const axis2_env_t *env,
axis2_msg_ctx_t *msg_ctx);
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_free
- (axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env);
+ (axis2_soap_over_http_sender_t *sender,
+ const axis2_env_t *env);
/***************************** End of function headers ************************/
axis2_soap_over_http_sender_t * AXIS2_CALL
@@ -109,32 +109,32 @@
sender_impl = (axis2_soap_over_http_sender_impl_t *)AXIS2_MALLOC
(env->allocator, sizeof(
axis2_soap_over_http_sender_impl_t));
-
+
if(NULL == sender_impl)
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
- }
-
+ }
+
sender_impl->http_version = AXIS2_HTTP_HEADER_PROTOCOL_11;
sender_impl->so_timeout = AXIS2_HTTP_DEFAULT_SO_TIMEOUT;
sender_impl->connection_timeout = AXIS2_HTTP_DEFAULT_CONNECTION_TIMEOUT;
- /* unlike the java impl we don't have a default om output
- * it should be explicitly set and it's a MUST
- */
- sender_impl->om_output = NULL;
- sender_impl->chunked = AXIS2_FALSE;
- sender_impl->client = NULL;
+ /* unlike the java impl we don't have a default om output
+ * it should be explicitly set and it's a MUST
+ */
+ sender_impl->om_output = NULL;
+ sender_impl->chunked = AXIS2_FALSE;
+ sender_impl->client = NULL;
sender_impl->sender.ops = AXIS2_MALLOC(env->allocator,
sizeof(axis2_soap_over_http_sender_ops_t));
if(NULL == sender_impl->sender.ops)
- {
- axis2_soap_over_http_sender_free((axis2_soap_over_http_sender_t*)
- sender_impl, env);
+ {
+ axis2_soap_over_http_sender_free((axis2_soap_over_http_sender_t*)
+ sender_impl, env);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
- }
+ }
sender_impl->sender.ops->send =
axis2_soap_over_http_sender_send;
@@ -142,11 +142,11 @@
axis2_soap_over_http_sender_set_chunked;
sender_impl->sender.ops->set_om_output =
axis2_soap_over_http_sender_set_om_output;
- sender_impl->sender.ops->set_http_version =
- axis2_soap_over_http_sender_set_http_version;
+ sender_impl->sender.ops->set_http_version =
+ axis2_soap_over_http_sender_set_http_version;
sender_impl->sender.ops->free =
axis2_soap_over_http_sender_free;
- return &(sender_impl->sender);
+ return &(sender_impl->sender);
}
axis2_status_t AXIS2_CALL
@@ -154,7 +154,7 @@
const axis2_env_t *env)
{
axis2_soap_over_http_sender_impl_t *sender_impl = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
sender_impl = AXIS2_INTF_TO_IMPL(sender);
if(NULL != sender_impl->http_version)
@@ -169,46 +169,46 @@
* of the response soap message
*/
sender_impl->client = NULL;
- AXIS2_FREE(env->allocator, sender_impl);
- return AXIS2_SUCCESS;
+ AXIS2_FREE(env->allocator, sender_impl);
+ return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_send
- (axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx,
- axis2_soap_envelope_t *out, axis2_char_t *str_url,
- axis2_char_t *soap_action)
+ (axis2_soap_over_http_sender_t *sender,
+ const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx,
+ axis2_soap_envelope_t *out, axis2_char_t *str_url,
+ axis2_char_t *soap_action)
{
- axis2_http_simple_request_t *request = NULL;
- axis2_http_request_line_t *request_line = NULL;
- axis2_url_t *url = NULL;
- axis2_soap_over_http_sender_impl_t *sender_impl = NULL;
- axis2_xml_writer_t *xml_writer = NULL;
- axis2_char_t *buffer = NULL;
- axis2_char_t *char_set_enc = NULL;
- int status_code = -1;
- axis2_http_header_t *http_header = NULL;
- axis2_http_simple_response_t *response = NULL;
- axis2_char_t *content_type = NULL;
+ axis2_http_simple_request_t *request = NULL;
+ axis2_http_request_line_t *request_line = NULL;
+ axis2_url_t *url = NULL;
+ axis2_soap_over_http_sender_impl_t *sender_impl = NULL;
+ axis2_xml_writer_t *xml_writer = NULL;
+ axis2_char_t *buffer = NULL;
+ axis2_char_t *char_set_enc = NULL;
+ int status_code = -1;
+ axis2_http_header_t *http_header = NULL;
+ axis2_http_simple_response_t *response = NULL;
+ axis2_char_t *content_type = NULL;
axis2_property_t *property = NULL;
axis2_byte_t *output_stream = NULL;
int output_stream_size = 0;
axis2_bool_t doing_mtom = AXIS2_FALSE;
-
+
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK(env->error, out, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK(env->error, str_url, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK(env->error, soap_action, AXIS2_FAILURE);
-
- url = axis2_url_parse_string(env, str_url);
- sender_impl = AXIS2_INTF_TO_IMPL(sender);
- if(NULL == url)
- {
- return AXIS2_FAILURE;
- }
+ AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, out, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, str_url, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, soap_action, AXIS2_FAILURE);
+
+ url = axis2_url_parse_string(env, str_url);
+ sender_impl = AXIS2_INTF_TO_IMPL(sender);
+ if(NULL == url)
+ {
+ return AXIS2_FAILURE;
+ }
if (sender_impl->client)
{
@@ -216,11 +216,11 @@
sender_impl->client = NULL;
}
- sender_impl->client = axis2_http_client_create(env, url);
- if(NULL == sender_impl->client)
- {
- return AXIS2_FAILURE;
- }
+ sender_impl->client = axis2_http_client_create(env, url);
+ if(NULL == sender_impl->client)
+ {
+ return AXIS2_FAILURE;
+ }
/* configure proxy settings if we have set so
*/
axis2_soap_over_http_sender_configure_proxy(sender, env, msg_ctx);
@@ -237,31 +237,31 @@
doing_mtom = AXIS2_MSG_CTX_GET_DOING_MTOM(msg_ctx, env);
- if(NULL == sender_impl->om_output)
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_OM_OUTPUT,
- AXIS2_FAILURE);
- return AXIS2_FAILURE;
- }
- xml_writer = AXIS2_OM_OUTPUT_GET_XML_WRITER(sender_impl->om_output, env);
-
- property = AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env,
- AXIS2_CHARACTER_SET_ENCODING, AXIS2_FALSE);
+ if(NULL == sender_impl->om_output)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_OM_OUTPUT,
+ AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+ xml_writer = AXIS2_OM_OUTPUT_GET_XML_WRITER(sender_impl->om_output, env);
+
+ property = AXIS2_MSG_CTX_GET_PROPERTY(msg_ctx, env,
+ AXIS2_CHARACTER_SET_ENCODING, AXIS2_FALSE);
if(property)
{
char_set_enc = AXIS2_PROPERTY_GET_VALUE(property, env);
property = NULL;
}
- if(NULL == char_set_enc)
- {
- char_set_enc = AXIS2_DEFAULT_CHAR_SET_ENCODING;
- }
-
+ if(NULL == char_set_enc)
+ {
+ char_set_enc = AXIS2_DEFAULT_CHAR_SET_ENCODING;
+ }
+
AXIS2_OM_OUTPUT_SET_DO_OPTIMIZE(sender_impl->om_output, env,
- doing_mtom);
-
- AXIS2_SOAP_ENVELOPE_SERIALIZE (out, env, sender_impl->om_output,
- AXIS2_FALSE);
+ doing_mtom);
+
+ AXIS2_SOAP_ENVELOPE_SERIALIZE (out, env, sender_impl->om_output,
+ AXIS2_FALSE);
if (doing_mtom)
{
@@ -279,16 +279,16 @@
"from xml writer");
return AXIS2_FAILURE;
}
-
- request_line = axis2_http_request_line_create(env, "POST",
- AXIS2_URL_GET_PATH(url, env),
- sender_impl->http_version);
- request = axis2_http_simple_request_create(env, request_line, NULL, 0,
- NULL);
-
- http_header = axis2_http_header_create(env, AXIS2_HTTP_HEADER_USER_AGENT,
- "Axis2/C");
- AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(request, env, http_header);
+
+ request_line = axis2_http_request_line_create(env, "POST",
+ AXIS2_URL_GET_PATH(url, env),
+ sender_impl->http_version);
+ request = axis2_http_simple_request_create(env, request_line, NULL, 0,
+ NULL);
+
+ http_header = axis2_http_header_create(env, AXIS2_HTTP_HEADER_USER_AGENT,
+ "Axis2/C");
+ AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(request, env, http_header);
if(AXIS2_TRUE == AXIS2_MSG_CTX_GET_IS_SOAP_11(msg_ctx, env))
{
if('\"' != *soap_action)
@@ -309,9 +309,9 @@
AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(request, env, http_header);
}
- if(AXIS2_FALSE == sender_impl->chunked)
- {
- axis2_char_t tmp_buf[10];
+ if(AXIS2_FALSE == sender_impl->chunked)
+ {
+ axis2_char_t tmp_buf[10];
int size = 0;
if (buffer)
{
@@ -322,64 +322,64 @@
size = output_stream_size;
}
- sprintf(tmp_buf, "%d", size);
- http_header = axis2_http_header_create(env,
- AXIS2_HTTP_HEADER_CONTENT_LENGTH, tmp_buf);
- AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(request, env, http_header);
- }
- else
- {
- http_header = axis2_http_header_create(env,
- AXIS2_HTTP_HEADER_TRANSFER_ENCODING,
- AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED);
- AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(request, env, http_header);
- }
- /* TODO we need to set the content type with soap action header for soap12*/
+ sprintf(tmp_buf, "%d", size);
+ http_header = axis2_http_header_create(env,
+ AXIS2_HTTP_HEADER_CONTENT_LENGTH, tmp_buf);
+ AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(request, env, http_header);
+ }
+ else
+ {
+ http_header = axis2_http_header_create(env,
+ AXIS2_HTTP_HEADER_TRANSFER_ENCODING,
+ AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED);
+ AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(request, env, http_header);
+ }
+ /* TODO we need to set the content type with soap action header for soap12*/
if (doing_mtom)
{
content_type = AXIS2_OM_OUTPUT_GET_CONTENT_TYPE(sender_impl->om_output,
env);
}
- else if(AXIS2_TRUE == AXIS2_MSG_CTX_GET_IS_SOAP_11(msg_ctx, env))
- {
- content_type = AXIS2_HTTP_HEADER_ACCEPT_TEXT_XML;
+ else if(AXIS2_TRUE == AXIS2_MSG_CTX_GET_IS_SOAP_11(msg_ctx, env))
+ {
+ content_type = AXIS2_HTTP_HEADER_ACCEPT_TEXT_XML;
content_type = AXIS2_STRACAT(content_type, ";charset=", env);
content_type = AXIS2_STRACAT(content_type, char_set_enc, env);
- }
- else
- {
- content_type = AXIS2_HTTP_HEADER_ACCEPT_APPL_SOAP;
+ }
+ else
+ {
+ content_type = AXIS2_HTTP_HEADER_ACCEPT_APPL_SOAP;
content_type = AXIS2_STRACAT(content_type, ";charset=", env);
content_type = AXIS2_STRACAT(content_type, char_set_enc, env);
content_type = AXIS2_STRACAT(content_type, ";action=", env);
content_type = AXIS2_STRACAT(content_type, soap_action, env);
content_type = AXIS2_STRACAT(content_type, ";", env);
- }
- http_header = axis2_http_header_create(env, AXIS2_HTTP_HEADER_CONTENT_TYPE,
- content_type);
+ }
+ http_header = axis2_http_header_create(env, AXIS2_HTTP_HEADER_CONTENT_TYPE,
+ content_type);
if (content_type)
{
AXIS2_FREE(env->allocator, content_type);
content_type = NULL;
}
- AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(request, env, http_header);
- if(0 == AXIS2_STRCMP(sender_impl->http_version,
- AXIS2_HTTP_HEADER_PROTOCOL_11))
- {
+ AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(request, env, http_header);
+ if(0 == AXIS2_STRCMP(sender_impl->http_version,
+ AXIS2_HTTP_HEADER_PROTOCOL_11))
+ {
axis2_char_t *header = NULL;
header = AXIS2_MALLOC(env->allocator, AXIS2_STRLEN(
AXIS2_URL_GET_SERVER(url, env)) + 10 * sizeof(
axis2_char_t));
sprintf(header, "%s:%d", AXIS2_URL_GET_SERVER(url, env),
AXIS2_URL_GET_PORT(url, env));
- http_header = axis2_http_header_create(env,
- AXIS2_HTTP_HEADER_HOST,
- header);
+ http_header = axis2_http_header_create(env,
+ AXIS2_HTTP_HEADER_HOST,
+ header);
AXIS2_FREE(env->allocator, header);
header = NULL;
- AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(request, env, http_header);
- }
+ AXIS2_HTTP_SIMPLE_REQUEST_ADD_HEADER(request, env, http_header);
+ }
if (doing_mtom)
{
@@ -394,24 +394,24 @@
AXIS2_HTTP_SIMPLE_REQUEST_SET_BODY_STRING(request, env, buffer);
}
- axis2_soap_over_http_sender_get_timeout_values(sender, env, msg_ctx);
- AXIS2_HTTP_CLIENT_SET_TIMEOUT(sender_impl->client, env,
- sender_impl->so_timeout);
-
- status_code = AXIS2_HTTP_CLIENT_SEND(sender_impl->client, env, request);
+ axis2_soap_over_http_sender_get_timeout_values(sender, env, msg_ctx);
+ AXIS2_HTTP_CLIENT_SET_TIMEOUT(sender_impl->client, env,
+ sender_impl->so_timeout);
+
+ status_code = AXIS2_HTTP_CLIENT_SEND(sender_impl->client, env, request);
AXIS2_FREE(env->allocator, buffer);
buffer = NULL;
-
- AXIS2_HTTP_SIMPLE_REQUEST_FREE(request, env);
- request = NULL;
-
- status_code = AXIS2_HTTP_CLIENT_RECIEVE_HEADER(sender_impl->client, env);
+
+ AXIS2_HTTP_SIMPLE_REQUEST_FREE(request, env);
+ request = NULL;
+
+ status_code = AXIS2_HTTP_CLIENT_RECIEVE_HEADER(sender_impl->client, env);
if(status_code < 0)
- {
- return AXIS2_FAILURE;
- }
+ {
+ return AXIS2_FAILURE;
+ }
response = AXIS2_HTTP_CLIENT_GET_RESPONSE(sender_impl->client, env);
if(AXIS2_HTTP_RESPONSE_OK_CODE_VAL == status_code ||
AXIS2_HTTP_RESPONSE_ACK_CODE_VAL == status_code)
@@ -445,65 +445,65 @@
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_set_chunked
- (axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env, axis2_bool_t chunked)
+ (axis2_soap_over_http_sender_t *sender,
+ const axis2_env_t *env, axis2_bool_t chunked)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_INTF_TO_IMPL(sender)->chunked = chunked;
- return AXIS2_SUCCESS;
+ return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_set_om_output
- (axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env, axis2_om_output_t *om_output)
+ (axis2_soap_over_http_sender_t *sender,
+ const axis2_env_t *env, axis2_om_output_t *om_output)
{
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_INTF_TO_IMPL(sender)->om_output = om_output;
- return AXIS2_SUCCESS;
+ return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_get_header_info
- (axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx,
- axis2_http_simple_response_t *response)
+ (axis2_soap_over_http_sender_t *sender,
+ const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx,
+ axis2_http_simple_response_t *response)
{
- axis2_array_list_t *headers = NULL;
- axis2_char_t *charset = NULL;
- axis2_soap_over_http_sender_impl_t *sender_impl = NULL;
- int i = 0;
- axis2_bool_t response_chunked = AXIS2_FALSE;
- int *content_length = NULL;
+ axis2_array_list_t *headers = NULL;
+ axis2_char_t *charset = NULL;
+ axis2_soap_over_http_sender_impl_t *sender_impl = NULL;
+ int i = 0;
+ axis2_bool_t response_chunked = AXIS2_FALSE;
+ int *content_length = NULL;
axis2_property_t *property = NULL;
-
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK(env->error, response, AXIS2_FAILURE);
-
- sender_impl = AXIS2_INTF_TO_IMPL(sender);
-
- /*
- * TODO MTOM support (MIME header)
- */
- headers = AXIS2_HTTP_SIMPLE_RESPONSE_GET_HEADERS(response, env);
- if(headers == NULL)
- {
- return AXIS2_SUCCESS;
- }
- for(i = 0; i < AXIS2_ARRAY_LIST_SIZE(headers, env); i++)
- {
- axis2_http_header_t *header = AXIS2_ARRAY_LIST_GET(headers, env, i);
- axis2_char_t *name = AXIS2_HTTP_HEADER_GET_NAME((axis2_http_header_t *)
- header, env);
- if(NULL != name)
- {
- if(0 == AXIS2_STRCMP(name, AXIS2_HTTP_HEADER_TRANSFER_ENCODING) &&
- 0 == AXIS2_STRCMP(AXIS2_HTTP_HEADER_GET_VALUE(header
- , env), AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED))
- {
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
+ AXIS2_PARAM_CHECK(env->error, response, AXIS2_FAILURE);
+
+ sender_impl = AXIS2_INTF_TO_IMPL(sender);
+
+ /*
+ * TODO MTOM support (MIME header)
+ */
+ headers = AXIS2_HTTP_SIMPLE_RESPONSE_GET_HEADERS(response, env);
+ if(headers == NULL)
+ {
+ return AXIS2_SUCCESS;
+ }
+ for(i = 0; i < AXIS2_ARRAY_LIST_SIZE(headers, env); i++)
+ {
+ axis2_http_header_t *header = AXIS2_ARRAY_LIST_GET(headers, env, i);
+ axis2_char_t *name = AXIS2_HTTP_HEADER_GET_NAME((axis2_http_header_t *)
+ header, env);
+ if(NULL != name)
+ {
+ if(0 == AXIS2_STRCMP(name, AXIS2_HTTP_HEADER_TRANSFER_ENCODING) &&
+ 0 == AXIS2_STRCMP(AXIS2_HTTP_HEADER_GET_VALUE(header
+ , env), AXIS2_HTTP_HEADER_TRANSFER_ENCODING_CHUNKED))
+ {
axis2_char_t *transfer_encoding = NULL;
transfer_encoding =
@@ -512,109 +512,109 @@
property = axis2_property_create(env);
AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST);
AXIS2_PROPERTY_SET_VALUE(property, env, transfer_encoding);
- AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env,
- AXIS2_HTTP_HEADER_TRANSFER_ENCODING,
- property,
- AXIS2_FALSE);
- response_chunked = AXIS2_TRUE;
- }
- if(0 != AXIS2_STRCMP(name, AXIS2_HTTP_HEADER_CONTENT_TYPE))
- {
- axis2_char_t *tmp_charset = NULL;
- axis2_char_t *content_type = AXIS2_HTTP_HEADER_GET_VALUE(header,
- env);
- tmp_charset = strstr(content_type, AXIS2_HTTP_CHAR_SET_ENCODING);
- if(NULL != charset)
- {
- charset = AXIS2_STRDUP(tmp_charset, env);
- break;
- }
- }
- }
- }
- if(NULL != charset)
- {
- axis2_ctx_t *axis_ctx = AXIS2_OP_CTX_GET_BASE(AXIS2_MSG_CTX_GET_OP_CTX(
- msg_ctx, env), env);
- if(NULL != axis_ctx)
- {
+ AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env,
+ AXIS2_HTTP_HEADER_TRANSFER_ENCODING,
+ property,
+ AXIS2_FALSE);
+ response_chunked = AXIS2_TRUE;
+ }
+ if(0 != AXIS2_STRCMP(name, AXIS2_HTTP_HEADER_CONTENT_TYPE))
+ {
+ axis2_char_t *tmp_charset = NULL;
+ axis2_char_t *content_type = AXIS2_HTTP_HEADER_GET_VALUE(header,
+ env);
+ tmp_charset = strstr(content_type, AXIS2_HTTP_CHAR_SET_ENCODING);
+ if(NULL != charset)
+ {
+ charset = AXIS2_STRDUP(tmp_charset, env);
+ break;
+ }
+ }
+ }
+ }
+ if(NULL != charset)
+ {
+ axis2_ctx_t *axis_ctx = AXIS2_OP_CTX_GET_BASE(AXIS2_MSG_CTX_GET_OP_CTX(
+ msg_ctx, env), env);
+ if(NULL != axis_ctx)
+ {
property = axis2_property_create(env);
AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST);
AXIS2_PROPERTY_SET_VALUE(property, env, charset);
- AXIS2_CTX_SET_PROPERTY(axis_ctx, env, AXIS2_CHARACTER_SET_ENCODING,
- property, AXIS2_FALSE);
- }
- }
- if(AXIS2_FALSE == response_chunked)
- {
- int tmp_len = 0;
- content_length = AXIS2_MALLOC(env->allocator, sizeof(int));
- if(NULL == content_length)
- {
- return AXIS2_FAILURE;
- }
- tmp_len = AXIS2_HTTP_SIMPLE_RESPONSE_GET_CONTENT_LENGTH(response, env);
- memcpy(content_length, &tmp_len, sizeof(int));
+ AXIS2_CTX_SET_PROPERTY(axis_ctx, env, AXIS2_CHARACTER_SET_ENCODING,
+ property, AXIS2_FALSE);
+ }
+ }
+ if(AXIS2_FALSE == response_chunked)
+ {
+ int tmp_len = 0;
+ content_length = AXIS2_MALLOC(env->allocator, sizeof(int));
+ if(NULL == content_length)
+ {
+ return AXIS2_FAILURE;
+ }
+ tmp_len = AXIS2_HTTP_SIMPLE_RESPONSE_GET_CONTENT_LENGTH(response, env);
+ memcpy(content_length, &tmp_len, sizeof(int));
property = axis2_property_create(env);
AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST);
AXIS2_PROPERTY_SET_VALUE(property, env, content_length);
- AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env,
- AXIS2_HTTP_HEADER_CONTENT_LENGTH, property,
- AXIS2_FALSE);
- }
- return AXIS2_SUCCESS;
+ AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env,
+ AXIS2_HTTP_HEADER_CONTENT_LENGTH, property,
+ AXIS2_FALSE);
+ }
+ return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_process_response
- (axis2_soap_over_http_sender_t *sender,
+ (axis2_soap_over_http_sender_t *sender,
const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx,
- axis2_http_simple_response_t *response)
+ axis2_http_simple_response_t *response)
{
axis2_stream_t *in_stream = NULL;
axis2_property_t *property = NULL;
-
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, msg_ctx, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK(env->error, response, AXIS2_FAILURE);
-
- in_stream = AXIS2_HTTP_SIMPLE_RESPONSE_GET_BODY(response, env);
- if(NULL == in_stream)
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_STREAM_IN_RESPONSE_BODY,
- AXIS2_FAILURE);
- return AXIS2_FAILURE;
- }
-
- axis2_soap_over_http_sender_get_header_info(sender, env, msg_ctx, response);
- /*axis_ctx = AXIS2_OP_CTX_GET_BASE(AXIS2_MSG_CTX_GET_OP_CTX(msg_ctx, env),
- env);*/
+ AXIS2_PARAM_CHECK(env->error, response, AXIS2_FAILURE);
+
+ in_stream = AXIS2_HTTP_SIMPLE_RESPONSE_GET_BODY(response, env);
+ if(NULL == in_stream)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_STREAM_IN_RESPONSE_BODY,
+ AXIS2_FAILURE);
+ return AXIS2_FAILURE;
+ }
+
+ axis2_soap_over_http_sender_get_header_info(sender, env, msg_ctx, response);
+ /*axis_ctx = AXIS2_OP_CTX_GET_BASE(AXIS2_MSG_CTX_GET_OP_CTX(msg_ctx, env),
+ env);*/
property = axis2_property_create(env);
AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST);
AXIS2_PROPERTY_SET_FREE_FUNC(property, env, axis2_stream_free_void_arg);
AXIS2_PROPERTY_SET_VALUE(property, env, in_stream);
- /*AXIS2_CTX_SET_PROPERTY(axis_ctx, env, AXIS2_TRANSPORT_IN, property,
- AXIS2_FALSE);*/
- AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, AXIS2_TRANSPORT_IN, property,
- AXIS2_FALSE);
- return AXIS2_SUCCESS;
+ /*AXIS2_CTX_SET_PROPERTY(axis_ctx, env, AXIS2_TRANSPORT_IN, property,
+ AXIS2_FALSE);*/
+ AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, AXIS2_TRANSPORT_IN, property,
+ AXIS2_FALSE);
+ return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_get_timeout_values
- (axis2_soap_over_http_sender_t *sender,
+ (axis2_soap_over_http_sender_t *sender,
const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx)
{
axis2_char_t *so_str = NULL;
- axis2_char_t *connection_str = NULL;
+ axis2_char_t *connection_str = NULL;
axis2_param_t *tmp_param = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
-
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+
tmp_param = AXIS2_MSG_CTX_GET_PARAMETER(msg_ctx,
- env, AXIS2_HTTP_SO_TIMEOUT);
-
+ env, AXIS2_HTTP_SO_TIMEOUT);
+
if(NULL != tmp_param)
{
so_str = (axis2_char_t*)AXIS2_PARAM_GET_VALUE(tmp_param, env);
@@ -634,26 +634,26 @@
AXIS2_ATOI(connection_str);
}
}
- return AXIS2_SUCCESS;
+ return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_set_http_version
- (axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env, axis2_char_t *version)
+ (axis2_soap_over_http_sender_t *sender,
+ const axis2_env_t *env, axis2_char_t *version)
{
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_INTF_TO_IMPL(sender)->http_version = AXIS2_STRDUP(version, env);
- if(NULL == AXIS2_INTF_TO_IMPL(sender)->http_version)
- {
- return AXIS2_FAILURE;
- }
- return AXIS2_SUCCESS;
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_INTF_TO_IMPL(sender)->http_version = AXIS2_STRDUP(version, env);
+ if(NULL == AXIS2_INTF_TO_IMPL(sender)->http_version)
+ {
+ return AXIS2_FAILURE;
+ }
+ return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
axis2_soap_over_http_sender_configure_proxy(axis2_soap_over_http_sender_t *sender,
- const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx)
+ const axis2_env_t *env, axis2_msg_ctx_t *msg_ctx)
{
axis2_conf_ctx_t *conf_ctx = NULL;
axis2_conf_t *conf = NULL;
Modified: webservices/axis2/trunk/c/modules/core/transport/http/sender/ssl/ssl_stream.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/sender/ssl/ssl_stream.c?rev=411506&r1=411505&r2=411506&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/sender/ssl/ssl_stream.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/sender/ssl/ssl_stream.c Sat Jun 3 20:09:08 2006
@@ -21,13 +21,13 @@
/**
* @brief Stream struct impl
- * Streaming mechanisms for SSL
+ * Streaming mechanisms for SSL
*/
typedef struct ssl_stream_impl ssl_stream_impl_t;
struct ssl_stream_impl
{
- axis2_stream_t stream;
+ axis2_stream_t stream;
axis2_stream_type_t stream_type;
SSL *ssl;
SSL_CTX *ctx;
@@ -45,10 +45,10 @@
int AXIS2_CALL
axis2_ssl_stream_write(axis2_stream_t *stream, const axis2_env_t *env,
- const void *buffer, size_t count);
+ const void *buffer, size_t count);
int AXIS2_CALL
axis2_ssl_stream_read(axis2_stream_t *stream, const axis2_env_t *env,
- void *buffer, size_t count);
+ void *buffer, size_t count);
int AXIS2_CALL
axis2_ssl_stream_skip(axis2_stream_t *stream, const axis2_env_t *env, int count);
@@ -60,16 +60,16 @@
axis2_stream_create_ssl(const axis2_env_t *env, axis2_socket_t socket)
{
ssl_stream_impl_t *stream_impl = NULL;
- AXIS2_ENV_CHECK(env, NULL);
-
+ AXIS2_ENV_CHECK(env, NULL);
+
stream_impl = (ssl_stream_impl_t *)AXIS2_MALLOC(
env->allocator, sizeof(ssl_stream_impl_t));
-
- if(NULL == stream_impl)
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+
+ if(NULL == stream_impl)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
- }
+ }
stream_impl->stream.ops = NULL;
stream_impl->socket = socket;
stream_impl->ctx = NULL;
@@ -90,23 +90,23 @@
return NULL;
}
stream_impl->stream_type = AXIS2_STREAM_MANAGED;
- stream_impl->stream.ops = (axis2_stream_ops_t *) AXIS2_MALLOC (
+ stream_impl->stream.ops = (axis2_stream_ops_t *) AXIS2_MALLOC (
env->allocator, sizeof (axis2_stream_ops_t));
- if (NULL == stream_impl->stream.ops)
- {
- axis2_ssl_stream_free(&(stream_impl->stream), env);
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
-
- stream_impl->stream.ops->free = axis2_ssl_stream_free;
+ if (NULL == stream_impl->stream.ops)
+ {
+ axis2_ssl_stream_free(&(stream_impl->stream), env);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ stream_impl->stream.ops->free = axis2_ssl_stream_free;
stream_impl->stream.ops->read = axis2_ssl_stream_read;
stream_impl->stream.ops->write = axis2_ssl_stream_write;
stream_impl->stream.ops->skip = axis2_ssl_stream_skip;
stream_impl->stream.ops->get_char = axis2_ssl_stream_get_char;
stream_impl->stream.ops->get_type = axis2_ssl_stream_get_type;
- return &(stream_impl->stream);
+ return &(stream_impl->stream);
}
@@ -114,22 +114,22 @@
axis2_ssl_stream_free (axis2_stream_t *stream, const axis2_env_t *env)
{
ssl_stream_impl_t *stream_impl = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
- stream_impl = AXIS2_INTF_TO_IMPL(stream);
- if (NULL != stream_impl->stream.ops)
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ stream_impl = AXIS2_INTF_TO_IMPL(stream);
+ if (NULL != stream_impl->stream.ops)
{
AXIS2_FREE (env->allocator, stream_impl->stream.ops);
}
axis2_ssl_utils_cleanup_ssl(env, stream_impl->ctx, stream_impl->ssl);
- AXIS2_FREE(env->allocator, stream_impl);
-
+ AXIS2_FREE(env->allocator, stream_impl);
+
return AXIS2_SUCCESS;
}
int AXIS2_CALL
axis2_ssl_stream_read(axis2_stream_t *stream, const axis2_env_t *env,
- void *buffer, size_t count)
+ void *buffer, size_t count)
{
ssl_stream_impl_t *stream_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
@@ -161,9 +161,9 @@
int AXIS2_CALL
axis2_ssl_stream_write(axis2_stream_t *stream, const axis2_env_t *env,
- const void *buf, size_t count)
+ const void *buf, size_t count)
{
- ssl_stream_impl_t *stream_impl = NULL;
+ ssl_stream_impl_t *stream_impl = NULL;
int write = -1;
AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
@@ -187,11 +187,11 @@
int AXIS2_CALL
axis2_ssl_stream_skip(axis2_stream_t *stream, const axis2_env_t *env, int count)
{
- ssl_stream_impl_t *stream_impl = NULL;
+ ssl_stream_impl_t *stream_impl = NULL;
axis2_char_t *tmp_buffer = NULL;
int len = -1;
- AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
- stream_impl = AXIS2_INTF_TO_IMPL(stream);
+ AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
+ stream_impl = AXIS2_INTF_TO_IMPL(stream);
tmp_buffer = AXIS2_MALLOC(env->allocator, count * sizeof(axis2_char_t));
if(tmp_buffer == NULL)
@@ -209,8 +209,8 @@
int AXIS2_CALL
axis2_ssl_stream_get_char(axis2_stream_t *stream, const axis2_env_t *env)
{
- int ret = -1;
- AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
+ int ret = -1;
+ AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
/* TODO implement this */
return ret;
Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_out_transport_info.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_out_transport_info.c?rev=411506&r1=411505&r2=411506&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_out_transport_info.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_out_transport_info.c Sat Jun 3 20:09:08 2006
@@ -23,15 +23,15 @@
/**
* @brief Apache2 Out transport info impl structure
- * Axis2 apache2_out_transport_info_impl
+ * Axis2 apache2_out_transport_info_impl
*/
typedef struct axis2_apache2_out_transport_info_impl
- axis2_apache2_out_transport_info_impl_t;
+ axis2_apache2_out_transport_info_impl_t;
struct axis2_apache2_out_transport_info_impl
{
- axis2_http_out_transport_info_t out_transport_info;
- request_rec *request;
+ axis2_http_out_transport_info_t out_transport_info;
+ request_rec *request;
axis2_char_t *encoding;
};
@@ -41,18 +41,18 @@
/***************************** Function headers *******************************/
axis2_status_t AXIS2_CALL
axis2_http_out_transport_info_set_content_type
- (axis2_http_out_transport_info_t *info, const axis2_env_t *env,
- axis2_char_t *content_type);
+ (axis2_http_out_transport_info_t *info, const axis2_env_t *env,
+ axis2_char_t *content_type);
axis2_status_t AXIS2_CALL
axis2_http_out_transport_info_set_char_encoding
- (axis2_http_out_transport_info_t *info, const axis2_env_t *env,
- axis2_char_t *encoding);
+ (axis2_http_out_transport_info_t *info, const axis2_env_t *env,
+ axis2_char_t *encoding);
axis2_status_t AXIS2_CALL
axis2_http_out_transport_info_free
- (axis2_http_out_transport_info_t *out_transport_info,
- const axis2_env_t *env);
+ (axis2_http_out_transport_info_t *out_transport_info,
+ const axis2_env_t *env);
/***************************** End of function headers ************************/
@@ -66,45 +66,45 @@
info_impl = (axis2_apache2_out_transport_info_impl_t *)AXIS2_MALLOC
(env->allocator, sizeof(
axis2_apache2_out_transport_info_impl_t));
-
+
if(NULL == info_impl)
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
- }
+ }
info_impl->request = request;
- info_impl->encoding = NULL;
+ info_impl->encoding = NULL;
info_impl->out_transport_info.ops = AXIS2_MALLOC(env->allocator,
- sizeof(axis2_http_out_transport_info_ops_t));
+ sizeof(axis2_http_out_transport_info_ops_t));
if(NULL == info_impl->out_transport_info.ops)
- {
- axis2_http_out_transport_info_free((axis2_http_out_transport_info_t*)
+ {
+ axis2_http_out_transport_info_free((axis2_http_out_transport_info_t*)
info_impl, env);
AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
+ return NULL;
+ }
info_impl->out_transport_info.ops->set_content_type =
- axis2_http_out_transport_info_set_content_type;
+ axis2_http_out_transport_info_set_content_type;
info_impl->out_transport_info.ops->set_char_encoding =
- axis2_http_out_transport_info_set_char_encoding;
+ axis2_http_out_transport_info_set_char_encoding;
info_impl->out_transport_info.ops->free =
- axis2_http_out_transport_info_free;
+ axis2_http_out_transport_info_free;
- return &(info_impl->out_transport_info);
+ return &(info_impl->out_transport_info);
}
axis2_status_t AXIS2_CALL
axis2_http_out_transport_info_free (axis2_http_out_transport_info_t *info,
- const axis2_env_t *env)
+ const axis2_env_t *env)
{
axis2_apache2_out_transport_info_impl_t *info_impl = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
info_impl = AXIS2_INTF_TO_IMPL(info);
-
- info_impl->request = NULL; /* request doesn't belong to info */
+
+ info_impl->request = NULL; /* request doesn't belong to info */
if(NULL != info_impl->encoding)
{
AXIS2_FREE(env->allocator, info_impl->encoding);
@@ -113,8 +113,8 @@
if(NULL != info->ops)
AXIS2_FREE(env->allocator, info->ops);
- AXIS2_FREE(env->allocator, info_impl);
- return AXIS2_SUCCESS;
+ AXIS2_FREE(env->allocator, info_impl);
+ return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
@@ -130,53 +130,53 @@
axis2_status_t AXIS2_CALL
axis2_http_out_transport_info_set_content_type
- (axis2_http_out_transport_info_t *info, const axis2_env_t *env,
- axis2_char_t *content_type)
+ (axis2_http_out_transport_info_t *info, const axis2_env_t *env,
+ axis2_char_t *content_type)
{
axis2_char_t *tmp1 = NULL;
- axis2_char_t *tmp2 = NULL;
- axis2_apache2_out_transport_info_impl_t *info_impl = NULL;
-
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ axis2_char_t *tmp2 = NULL;
+ axis2_apache2_out_transport_info_impl_t *info_impl = NULL;
+
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
AXIS2_PARAM_CHECK(env->error, content_type, AXIS2_FAILURE);
-
- info_impl = AXIS2_INTF_TO_IMPL(info);
-
- if(NULL != info_impl->encoding)
- {
-
- tmp1 = AXIS2_STRACAT(content_type, ";charset=", env);
- tmp2 = AXIS2_STRACAT(tmp1, info_impl->encoding, env);
+
+ info_impl = AXIS2_INTF_TO_IMPL(info);
+
+ if(NULL != info_impl->encoding)
+ {
+
+ tmp1 = AXIS2_STRACAT(content_type, ";charset=", env);
+ tmp2 = AXIS2_STRACAT(tmp1, info_impl->encoding, env);
info_impl->request->content_type = apr_pstrdup(info_impl->request->pool,
tmp2);
- AXIS2_FREE(env->allocator, tmp1);
- AXIS2_FREE(env->allocator, tmp2);
- }
- else
- {
- info_impl->request->content_type = apr_pstrdup(info_impl->request->pool,
+ AXIS2_FREE(env->allocator, tmp1);
+ AXIS2_FREE(env->allocator, tmp2);
+ }
+ else
+ {
+ info_impl->request->content_type = apr_pstrdup(info_impl->request->pool,
content_type);
- }
- return AXIS2_SUCCESS;
+ }
+ return AXIS2_SUCCESS;
}
axis2_status_t AXIS2_CALL
axis2_http_out_transport_info_set_char_encoding
- (axis2_http_out_transport_info_t *info, const axis2_env_t *env,
- axis2_char_t *encoding)
+ (axis2_http_out_transport_info_t *info, const axis2_env_t *env,
+ axis2_char_t *encoding)
{
axis2_apache2_out_transport_info_impl_t *info_impl = NULL;
AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
- AXIS2_PARAM_CHECK(env->error, encoding, AXIS2_FAILURE);
-
+ AXIS2_PARAM_CHECK(env->error, encoding, AXIS2_FAILURE);
+
info_impl = AXIS2_INTF_TO_IMPL(info);
-
- if(NULL != info_impl->encoding)
- {
- AXIS2_FREE(env->allocator, info_impl->encoding);
- }
- info_impl->encoding = AXIS2_STRDUP(encoding, env);
-
- return AXIS2_SUCCESS;
+
+ if(NULL != info_impl->encoding)
+ {
+ AXIS2_FREE(env->allocator, info_impl->encoding);
+ }
+ info_impl->encoding = AXIS2_STRDUP(encoding, env);
+
+ return AXIS2_SUCCESS;
}
Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_stream.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_stream.c?rev=411506&r1=411505&r2=411506&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_stream.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/apache2_stream.c Sat Jun 3 20:09:08 2006
@@ -21,13 +21,13 @@
/**
* @brief Stream struct impl
- * Streaming mechanisms for Apache2 web server
+ * Streaming mechanisms for Apache2 web server
*/
typedef struct apache2_stream_impl apache2_stream_impl_t;
struct apache2_stream_impl
{
- axis2_stream_t stream;
+ axis2_stream_t stream;
axis2_stream_type_t stream_type;
request_rec *request;
};
@@ -43,10 +43,10 @@
int AXIS2_CALL
apache2_stream_write(axis2_stream_t *stream, const axis2_env_t *env,
- const void *buffer, size_t count);
+ const void *buffer, size_t count);
int AXIS2_CALL
apache2_stream_read(axis2_stream_t *stream, const axis2_env_t *env,
- void *buffer, size_t count);
+ void *buffer, size_t count);
int AXIS2_CALL
apache2_stream_skip(axis2_stream_t *stream, const axis2_env_t *env, int count);
@@ -61,37 +61,37 @@
axis2_stream_create_apache2(const axis2_env_t *env, request_rec *request)
{
apache2_stream_impl_t *stream_impl = NULL;
- AXIS2_ENV_CHECK(env, NULL);
+ AXIS2_ENV_CHECK(env, NULL);
AXIS2_PARAM_CHECK(env->error, request, NULL);
-
+
stream_impl = (apache2_stream_impl_t *)AXIS2_MALLOC(
env->allocator, sizeof(apache2_stream_impl_t));
-
- if(NULL == stream_impl)
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+
+ if(NULL == stream_impl)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
return NULL;
- }
+ }
stream_impl->request = request;
stream_impl->stream_type = AXIS2_STREAM_MANAGED;
- stream_impl->stream.ops = (axis2_stream_ops_t *) AXIS2_MALLOC (
+ stream_impl->stream.ops = (axis2_stream_ops_t *) AXIS2_MALLOC (
env->allocator, sizeof (axis2_stream_ops_t));
- if (NULL == stream_impl->stream.ops)
- {
- apache2_stream_free(&(stream_impl->stream), env);
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
- return NULL;
- }
-
- stream_impl->stream.ops->free = apache2_stream_free;
+ if (NULL == stream_impl->stream.ops)
+ {
+ apache2_stream_free(&(stream_impl->stream), env);
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ return NULL;
+ }
+
+ stream_impl->stream.ops->free = apache2_stream_free;
stream_impl->stream.ops->read = apache2_stream_read;
stream_impl->stream.ops->write = apache2_stream_write;
stream_impl->stream.ops->skip = apache2_stream_skip;
stream_impl->stream.ops->get_char = apache2_stream_get_char;
stream_impl->stream.ops->get_type = apache2_stream_get_type;
- return &(stream_impl->stream);
+ return &(stream_impl->stream);
}
@@ -99,24 +99,24 @@
apache2_stream_free (axis2_stream_t *stream, const axis2_env_t *env)
{
apache2_stream_impl_t *stream_impl = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
-
- stream_impl = AXIS2_INTF_TO_IMPL(stream);
- if (NULL != stream_impl->stream.ops)
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+
+ stream_impl = AXIS2_INTF_TO_IMPL(stream);
+ if (NULL != stream_impl->stream.ops)
{
AXIS2_FREE (env->allocator, stream_impl->stream.ops);
}
- AXIS2_FREE(env->allocator, stream_impl);
-
+ AXIS2_FREE(env->allocator, stream_impl);
+
return AXIS2_SUCCESS;
}
int AXIS2_CALL
apache2_stream_read(axis2_stream_t *stream, const axis2_env_t *env,
- void *buffer, size_t count)
+ void *buffer, size_t count)
{
apache2_stream_impl_t *stream_impl = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
+ AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
stream_impl = AXIS2_INTF_TO_IMPL(stream);
return ap_get_client_block(stream_impl->request, buffer, count);
@@ -124,9 +124,9 @@
int AXIS2_CALL
apache2_stream_write(axis2_stream_t *stream, const axis2_env_t *env,
- const void *buf, size_t count)
+ const void *buf, size_t count)
{
- apache2_stream_impl_t *stream_impl = NULL;
+ apache2_stream_impl_t *stream_impl = NULL;
char *write_buf = NULL;
axis2_char_t *buffer = NULL;
AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
@@ -167,11 +167,11 @@
int AXIS2_CALL
apache2_stream_skip(axis2_stream_t *stream, const axis2_env_t *env, int count)
{
- apache2_stream_impl_t *stream_impl = NULL;
+ apache2_stream_impl_t *stream_impl = NULL;
axis2_char_t *tmp_buffer = NULL;
int len = -1;
- AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
- stream_impl = AXIS2_INTF_TO_IMPL(stream);
+ AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
+ stream_impl = AXIS2_INTF_TO_IMPL(stream);
tmp_buffer = AXIS2_MALLOC(env->allocator, count * sizeof(axis2_char_t));
if(tmp_buffer == NULL)
@@ -189,8 +189,8 @@
int AXIS2_CALL
apache2_stream_get_char(axis2_stream_t *stream, const axis2_env_t *env)
{
- int ret = -1;
- AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
+ int ret = -1;
+ AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
/* TODO implement this */
return ret;
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?rev=411506&r1=411505&r2=411506&view=diff
==============================================================================
--- 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 Jun 3 20:09:08 2006
@@ -34,14 +34,14 @@
#define READ_SIZE 32
/**
* @brief Apahche2 Worker struct impl
- * Axis2 Apache2 Worker impl
+ * Axis2 Apache2 Worker impl
*/
typedef struct axis2_apache2_worker_impl axis2_apache2_worker_impl_t;
struct axis2_apache2_worker_impl
{
- axis2_apache2_worker_t apache2_worker;
- axis2_conf_ctx_t *conf_ctx;
+ axis2_apache2_worker_t apache2_worker;
+ axis2_conf_ctx_t *conf_ctx;
};
#define AXIS2_INTF_TO_IMPL(apache2_worker) ((axis2_apache2_worker_impl_t *)\
@@ -51,7 +51,7 @@
int AXIS2_CALL
axis2_apache2_worker_process_request(axis2_apache2_worker_t *apache2_worker,
- const axis2_env_t *env, request_rec *req);
+ const axis2_env_t *env, request_rec *req);
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
axis2_apache2_worker_get_bytes(const axis2_env_t *env,
@@ -59,8 +59,8 @@
axis2_status_t AXIS2_CALL
axis2_apache2_worker_free(axis2_apache2_worker_t *apache2_worker,
- const axis2_env_t *env);
-
+ const axis2_env_t *env);
+
/***************************** End of function headers ************************/
AXIS2_EXTERN axis2_apache2_worker_t * AXIS2_CALL
@@ -70,12 +70,12 @@
AXIS2_ENV_CHECK(env, NULL);
apache2_worker_impl = (axis2_apache2_worker_impl_t *)
AXIS2_MALLOC (env->allocator, sizeof(axis2_apache2_worker_impl_t));
-
+
if(NULL == apache2_worker_impl)
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
+ {
+ 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 = build_conf_ctx(env, repo_path);
@@ -88,18 +88,18 @@
apache2_worker_impl->apache2_worker.ops = AXIS2_MALLOC(env->allocator,
sizeof(axis2_apache2_worker_ops_t));
if(NULL == apache2_worker_impl->apache2_worker.ops)
- {
- axis2_apache2_worker_free((axis2_apache2_worker_t*)apache2_worker_impl,
+ {
+ 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_impl->apache2_worker);
}
axis2_status_t AXIS2_CALL
@@ -107,7 +107,7 @@
const axis2_env_t *env)
{
axis2_apache2_worker_impl_t *worker_impl = NULL;
- AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
+ AXIS2_ENV_CHECK(env, AXIS2_FAILURE);
worker_impl = AXIS2_INTF_TO_IMPL(apache2_worker);
if(worker_impl->conf_ctx != NULL)
@@ -121,7 +121,7 @@
AXIS2_FREE(env->allocator, worker_impl->conf_ctx);
- return AXIS2_SUCCESS;
+ return AXIS2_SUCCESS;
}
int AXIS2_CALL
@@ -129,19 +129,19 @@
const axis2_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;
- axis2_stream_t *request_body = NULL;
+ axis2_conf_ctx_t *conf_ctx = NULL;
+ axis2_msg_ctx_t *msg_ctx = NULL;
+ axis2_stream_t *request_body = NULL;
axis2_stream_t *out_stream = NULL;
- axis2_transport_out_desc_t *out_desc = NULL;
- axis2_transport_in_desc_t *in_desc = NULL;
- axis2_char_t *http_version = NULL;
- axis2_char_t *soap_action = NULL;
- axis2_bool_t processed = AXIS2_FALSE;
- axis2_char_t *ctx_written = NULL;
- int content_length = -1;
- axis2_char_t *encoding_header_value = NULL;
- axis2_op_ctx_t *op_ctx = NULL;
+ axis2_transport_out_desc_t *out_desc = NULL;
+ axis2_transport_in_desc_t *in_desc = NULL;
+ axis2_char_t *http_version = NULL;
+ axis2_char_t *soap_action = NULL;
+ axis2_bool_t processed = AXIS2_FALSE;
+ axis2_char_t *ctx_written = NULL;
+ int content_length = -1;
+ axis2_char_t *encoding_header_value = NULL;
+ axis2_op_ctx_t *op_ctx = NULL;
axis2_char_t *req_url = NULL;
axis2_char_t *body_string = NULL;
int send_status = -1;
@@ -151,21 +151,21 @@
axis2_http_out_transport_info_t *apache2_out_transport_info = NULL;
axis2_qname_t *transport_qname = NULL;
axis2_char_t *ctx_uuid = NULL;
-
+
AXIS2_ENV_CHECK(env, AXIS2_CRTICAL_FAILURE);
AXIS2_PARAM_CHECK(env->error, request, AXIS2_CRTICAL_FAILURE);
-
- apache2_worker_impl = AXIS2_INTF_TO_IMPL(apache2_worker);
- conf_ctx = apache2_worker_impl->conf_ctx;
+
+ apache2_worker_impl = AXIS2_INTF_TO_IMPL(apache2_worker);
+ conf_ctx = apache2_worker_impl->conf_ctx;
url = axis2_url_create(env, "http",
(axis2_char_t*)ap_get_server_name(request),
ap_get_server_port(request), request->unparsed_uri);
- if(NULL == conf_ctx)
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_CONFIGURATION_CONTEXT,
+ if(NULL == conf_ctx)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_CONFIGURATION_CONTEXT,
AXIS2_FAILURE);
return AXIS2_CRTICAL_FAILURE;
- }
+ }
content_length = request->remaining;
http_version = request->protocol;
req_url = AXIS2_URL_TO_EXTERNAL_FORM(url, env);
@@ -178,31 +178,31 @@
content_length = -1;
request->chunked = 1;
}
- if(NULL == http_version)
- {
- AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_HTTP_VERSION,
- AXIS2_FAILURE);
+ if(NULL == http_version)
+ {
+ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NULL_HTTP_VERSION,
+ AXIS2_FAILURE);
return AXIS2_CRTICAL_FAILURE;
- }
+ }
out_stream = axis2_stream_create_basic(env);
- AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Client HTTP version %s",
- http_version);
-
- encoding_header_value = (axis2_char_t*)request->content_encoding;
+ AXIS2_LOG_DEBUG(env->log, AXIS2_LOG_SI, "Client HTTP version %s",
+ http_version);
+
+ encoding_header_value = (axis2_char_t*)request->content_encoding;
transport_qname = axis2_qname_create(env, AXIS2_TRANSPORT_HTTP, NULL,
- NULL);
- out_desc = AXIS2_CONF_GET_TRANSPORT_OUT(AXIS2_CONF_CTX_GET_CONF
- (apache2_worker_impl->conf_ctx, env), env,
+ NULL);
+ out_desc = AXIS2_CONF_GET_TRANSPORT_OUT(AXIS2_CONF_CTX_GET_CONF
+ (apache2_worker_impl->conf_ctx, env), env,
transport_qname);
- in_desc = AXIS2_CONF_GET_TRANSPORT_IN(AXIS2_CONF_CTX_GET_CONF
- (apache2_worker_impl->conf_ctx, env), env,
- transport_qname);
+ in_desc = AXIS2_CONF_GET_TRANSPORT_IN(AXIS2_CONF_CTX_GET_CONF
+ (apache2_worker_impl->conf_ctx, env), env,
+ transport_qname);
AXIS2_QNAME_FREE(transport_qname, env);
- msg_ctx = axis2_msg_ctx_create(env, conf_ctx, in_desc, out_desc);
- AXIS2_MSG_CTX_SET_SERVER_SIDE(msg_ctx, env, AXIS2_TRUE);
-
+ msg_ctx = axis2_msg_ctx_create(env, conf_ctx, in_desc, out_desc);
+ AXIS2_MSG_CTX_SET_SERVER_SIDE(msg_ctx, env, AXIS2_TRUE);
+
property = axis2_property_create(env);
AXIS2_PROPERTY_SET_SCOPE(property, env, AXIS2_SCOPE_REQUEST);
AXIS2_PROPERTY_SET_FREE_FUNC(property, env, axis2_stream_free_void_arg);
@@ -210,11 +210,11 @@
AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, AXIS2_TRANSPORT_OUT, property,
AXIS2_FALSE);
- /*AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, AXIS2_TRANSPORT_HEADERS,
- axis2_apache2_worker_get_headers(apache2_worker, env,
+ /*AXIS2_MSG_CTX_SET_PROPERTY(msg_ctx, env, AXIS2_TRANSPORT_HEADERS,
+ axis2_apache2_worker_get_headers(apache2_worker, env,
simple_request), AXIS2_FALSE);*/
ctx_uuid = axis2_uuid_gen(env);
- AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, ctx_uuid);
+ AXIS2_MSG_CTX_SET_SVC_GRP_CTX_ID(msg_ctx, env, ctx_uuid);
AXIS2_FREE(env->allocator, ctx_uuid);
property = axis2_property_create(env);
@@ -237,48 +237,48 @@
return AXIS2_CRTICAL_FAILURE;
}
if(M_GET == request->method_number)
- {
- processed = axis2_http_transport_utils_process_http_get_request
+ {
+ processed = axis2_http_transport_utils_process_http_get_request
(env, msg_ctx, request_body, out_stream,
content_type ,soap_action,
- req_url,
+ req_url,
conf_ctx,
axis2_http_transport_utils_get_request_params(env,
(axis2_char_t*)req_url));
- if(AXIS2_FALSE == processed)
- {
- body_string = axis2_http_transport_utils_get_services_html(env,
- conf_ctx);
+ if(AXIS2_FALSE == processed)
+ {
+ body_string = axis2_http_transport_utils_get_services_html(env,
+ conf_ctx);
request->content_type = "text/html";
/*axis2_apache2_worker_set_response_headers(apache2_worker, env, svr_conn,
simple_request, response, 0);*/
- send_status = OK;
- }
-
- }
+ send_status = OK;
+ }
+
+ }
else if(M_POST == request->method_number)
- {
+ {
axis2_status_t status = AXIS2_FAILURE;
- status = axis2_http_transport_utils_process_http_post_request
+ status = axis2_http_transport_utils_process_http_post_request
(env, msg_ctx, request_body, out_stream,
content_type , content_length,
soap_action,
(axis2_char_t*)req_url);
- if(status == AXIS2_FAILURE)
- {
- axis2_msg_ctx_t *fault_ctx = NULL;
- axis2_engine_t *engine = axis2_engine_create(env, conf_ctx);
- if(NULL == engine)
- {
+ if(status == AXIS2_FAILURE)
+ {
+ axis2_msg_ctx_t *fault_ctx = NULL;
+ axis2_engine_t *engine = axis2_engine_create(env, conf_ctx);
+ if(NULL == engine)
+ {
send_status = HTTP_INTERNAL_SERVER_ERROR;
- }
- fault_ctx = AXIS2_ENGINE_CREATE_FAULT_MSG_CTX(engine, env, msg_ctx);
+ }
+ fault_ctx = AXIS2_ENGINE_CREATE_FAULT_MSG_CTX(engine, env, msg_ctx);
AXIS2_ENGINE_SEND_FAULT(engine, env, fault_ctx);
body_string = axis2_apache2_worker_get_bytes(env, out_stream);
send_status = HTTP_INTERNAL_SERVER_ERROR;
AXIS2_MSG_CTX_FREE(fault_ctx, env);
- }
- }
+ }
+ }
if(-1 == send_status)
{
op_ctx = AXIS2_MSG_CTX_GET_OP_CTX(msg_ctx, env);
@@ -330,7 +330,7 @@
}
AXIS2_MSG_CTX_FREE(msg_ctx, env);
msg_ctx = NULL;
- return send_status;
+ return send_status;
}
AXIS2_EXTERN axis2_char_t* AXIS2_CALL
Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/axis2_apache2_out_transport_info.h
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/axis2_apache2_out_transport_info.h?rev=411506&r1=411505&r2=411506&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/axis2_apache2_out_transport_info.h (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/apache2/axis2_apache2_out_transport_info.h Sat Jun 3 20:09:08 2006
@@ -36,7 +36,7 @@
AXIS2_EXTERN axis2_http_out_transport_info_t * AXIS2_CALL
axis2_apache2_out_transport_info_create(const axis2_env_t *env,
- request_rec *r);
+ request_rec *r);
/**
* Free http_out_transport_info passed as void pointer. This will be
Modified: webservices/axis2/trunk/c/modules/core/transport/http/server/simple_axis2_server/http_server_main.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/transport/http/server/simple_axis2_server/http_server_main.c?rev=411506&r1=411505&r2=411506&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/core/transport/http/server/simple_axis2_server/http_server_main.c (original)
+++ webservices/axis2/trunk/c/modules/core/transport/http/server/simple_axis2_server/http_server_main.c Sat Jun 3 20:09:08 2006
@@ -37,15 +37,15 @@
/***************************** End of function headers ************************/
axis2_env_t* init_syetem_env(axis2_allocator_t *allocator, axis2_char_t *log_file)
{
- axis2_error_t *error = axis2_error_create(allocator);
- axis2_log_t *log = axis2_log_create(allocator, NULL, log_file);
- axis2_thread_pool_t *thread_pool = axis2_thread_pool_init(allocator);
+ axis2_error_t *error = axis2_error_create(allocator);
+ axis2_log_t *log = axis2_log_create(allocator, NULL, log_file);
+ axis2_thread_pool_t *thread_pool = axis2_thread_pool_init(allocator);
/* We need to init the parser in main thread before spawning child
* threads
*/
axis2_xml_reader_init();
- return axis2_env_create_with_error_log_thread_pool(allocator, error, log,
- thread_pool);
+ return axis2_env_create_with_error_log_thread_pool(allocator, error, log,
+ thread_pool);
}
void system_exit(axis2_env_t *env, int status)
@@ -55,29 +55,29 @@
{
AXIS2_TRANSPORT_RECEIVER_FREE(server, system_env);
}
- if(NULL != env)
- {
+ if(NULL != env)
+ {
allocator = env->allocator;
- axis2_env_free(env);
- }
+ axis2_env_free(env);
+ }
axis2_allocator_free(allocator);
axis2_xml_reader_cleanup();
- _exit(status);
+ _exit(status);
}
int main(int argc, char *argv[])
{
- axis2_allocator_t *allocator = NULL;
- axis2_env_t *env = NULL;
+ axis2_allocator_t *allocator = NULL;
+ axis2_env_t *env = NULL;
extern char *optarg;
extern int optopt;
int c;
axis2_log_levels_t log_level = AXIS2_LOG_LEVEL_DEBUG;
axis2_char_t *log_file = "axis2.log";
- int port = 9090;
+ int port = 9090;
axis2_char_t *repo_path = "../";
- axis2_http_socket_read_timeout = AXIS2_HTTP_DEFAULT_SO_TIMEOUT;
+ axis2_http_socket_read_timeout = AXIS2_HTTP_DEFAULT_SO_TIMEOUT;
while ((c = AXIS2_GETOPT(argc, argv, ":p:r:ht:l:f:")) != -1)
{
@@ -109,57 +109,57 @@
case ':':
fprintf(stderr, "\nOption -%c requires an operand\n", optopt);
usage(argv[0]);
- return -1;
- case '?':
- if (isprint (optopt))
- fprintf (stderr, "\nUnknown option `-%c'.\n", optopt);
- usage(argv[0]);
- return -1;
- }
- }
+ return -1;
+ case '?':
+ if (isprint (optopt))
+ fprintf (stderr, "\nUnknown option `-%c'.\n", optopt);
+ usage(argv[0]);
+ return -1;
+ }
+ }
- allocator = axis2_allocator_init(NULL);
+ allocator = axis2_allocator_init(NULL);
- if(NULL == allocator)
- {
- printf("[Axis2]Startup FAILED due to memory allocation failure\n");
- system_exit(NULL, -1);
- }
-
+ if(NULL == allocator)
+ {
+ printf("[Axis2]Startup FAILED due to memory allocation failure\n");
+ system_exit(NULL, -1);
+ }
+
env = init_syetem_env(allocator, log_file);
env->log->level = log_level;
-
+
axis2_error_init();
- system_env = env;
-
+ system_env = env;
+
#ifndef WIN32
signal(SIGINT, sig_handler);
- signal(SIGPIPE, sig_handler);
-#endif
+ signal(SIGPIPE, sig_handler);
+#endif
- AXIS2_LOG_INFO(env->log, "Starting Axis2 HTTP server....");
- AXIS2_LOG_INFO(env->log, "Server port : %d", port);
- AXIS2_LOG_INFO(env->log, "Repo location : %s", repo_path);
- AXIS2_LOG_INFO(env->log, "Read Timeout : %d ms", axis2_http_socket_read_timeout);
-
- server = axis2_http_server_create(env, repo_path, port);
- if(NULL == server)
- {
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Server creation failed: Error code:"
- " %d :: %s", env->error->error_number,
+ AXIS2_LOG_INFO(env->log, "Starting Axis2 HTTP server....");
+ AXIS2_LOG_INFO(env->log, "Server port : %d", port);
+ AXIS2_LOG_INFO(env->log, "Repo location : %s", repo_path);
+ AXIS2_LOG_INFO(env->log, "Read Timeout : %d ms", axis2_http_socket_read_timeout);
+
+ server = axis2_http_server_create(env, repo_path, port);
+ if(NULL == server)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Server creation failed: Error code:"
+ " %d :: %s", env->error->error_number,
AXIS2_ERROR_GET_MESSAGE(env->error));
- system_exit(env, -1);
-
- }
- printf("Started Simple Axis2 HTTP Server ...\n");
- if(AXIS2_TRANSPORT_RECEIVER_START(server, env) == AXIS2_FAILURE)
- {
- AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Server start failed: Error code:"
- " %d :: %s", env->error->error_number,
+ system_exit(env, -1);
+
+ }
+ printf("Started Simple Axis2 HTTP Server ...\n");
+ if(AXIS2_TRANSPORT_RECEIVER_START(server, env) == AXIS2_FAILURE)
+ {
+ AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "Server start failed: Error code:"
+ " %d :: %s", env->error->error_number,
AXIS2_ERROR_GET_MESSAGE(env->error));
- system_exit(env, -1);
- }
- return 0;
+ system_exit(env, -1);
+ }
+ return 0;
}
void usage(axis2_char_t* prog_name)
@@ -172,14 +172,14 @@
fprintf(stdout, " [-f LOG_FILE]\n");
fprintf(stdout, " Options :\n");
fprintf(stdout, "\t-p PORT \t use the port number PORT. The default port is"
- " 9090\n");
+ " 9090\n");
fprintf(stdout, "\t-r REPO_PATH \t use the repository path REPO_PATH. The"
- " default repository path is ../\n");
+ " default repository path is ../\n");
fprintf(stdout, "\t-t SOCKET_READ_TIMEOUT\t set socket read timeout to "
- "SOCKET_READ_TIMEOUT. Default timeout is 30 seconds\n");
+ "SOCKET_READ_TIMEOUT. Default timeout is 30 seconds\n");
fprintf(stdout, "\t-l LOG_LEVEL\t set log level to LOG_LEVEL. Available "
- "log levels range from 0(critical only) to 4(debug)."
- "\n\t\t\t Default log level is 4(debug).\n");
+ "log levels range from 0(critical only) to 4(debug)."
+ "\n\t\t\t Default log level is 4(debug).\n");
fprintf(stdout, "\t-f LOG_FILE\t set log file to LOG_FILE. Default is /dev/stderr\n");
fprintf(stdout, " Help :\n\t-h \t display this help screen.\n\n");
}
@@ -191,27 +191,27 @@
void sig_handler(int signal)
{
- switch(signal)
- {
- case SIGINT :
- {
- AXIS2_LOG_INFO(system_env->log, "Received signal SIGINT. Server "
- "shutting down");
- axis2_http_server_stop(server, system_env);
- AXIS2_LOG_INFO(system_env->log, "Shutdown complete ...");
- system_exit(system_env, 0);
- }
- case SIGPIPE :
- {
- AXIS2_LOG_INFO(system_env->log, "Received signal SIGPIPE. Client "
- "request serve aborted");
- return;
- }
- case SIGSEGV :
- {
- fprintf(stderr, "Received deadly signal SIGSEGV. Terminating\n");
- _exit(-1);
- }
- }
+ switch(signal)
+ {
+ case SIGINT :
+ {
+ AXIS2_LOG_INFO(system_env->log, "Received signal SIGINT. Server "
+ "shutting down");
+ axis2_http_server_stop(server, system_env);
+ AXIS2_LOG_INFO(system_env->log, "Shutdown complete ...");
+ system_exit(system_env, 0);
+ }
+ case SIGPIPE :
+ {
+ AXIS2_LOG_INFO(system_env->log, "Received signal SIGPIPE. Client "
+ "request serve aborted");
+ return;
+ }
+ case SIGSEGV :
+ {
+ fprintf(stderr, "Received deadly signal SIGSEGV. Terminating\n");
+ _exit(-1);
+ }
+ }
}
#endif
Modified: webservices/axis2/trunk/c/modules/mod_addr/mod_addr.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/mod_addr/mod_addr.c?rev=411506&r1=411505&r2=411506&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/mod_addr/mod_addr.c (original)
+++ webservices/axis2/trunk/c/modules/mod_addr/mod_addr.c Sat Jun 3 20:09:08 2006
@@ -112,7 +112,7 @@
axis2_get_instance(axis2_module_t **inst,
const axis2_env_t *env)
{
- *inst = axis2_mod_addr_create(env);
+ *inst = axis2_mod_addr_create(env);
if(!(*inst))
{
return AXIS2_FAILURE;
@@ -126,8 +126,8 @@
const axis2_env_t *env)
{
axis2_status_t status = AXIS2_FAILURE;
- if (inst)
- {
+ if (inst)
+ {
status = axis2_mod_addr_shutdown(inst, env);
}
return status;
Modified: webservices/axis2/trunk/c/modules/wsdl/builder/wsdl11_mep_finder.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/wsdl/builder/wsdl11_mep_finder.c?rev=411506&r1=411505&r2=411506&view=diff
==============================================================================
--- webservices/axis2/trunk/c/modules/wsdl/builder/wsdl11_mep_finder.c (original)
+++ webservices/axis2/trunk/c/modules/wsdl/builder/wsdl11_mep_finder.c Sat Jun 3 20:09:08 2006
@@ -19,7 +19,7 @@
axis2_char_t *AXIS2_CALL
axis2_wsdl11_mep_finder_get_mep(void *op,
- const axis2_env_t *env)
+ const axis2_env_t *env)
{
axis2_wsdl4c_optype_t op_type = axis2_wsdl4c_operation_get_type(op);
if(op_type == AXIS2_WSDL4C_OP_IN_OUT)
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org