From 4a01960cba446e046d5687279c024fa60b576d85 Mon Sep 17 00:00:00 2001 From: damitha Date: Wed, 7 Jul 2010 16:34:18 +0000 Subject: Patch in AXIS2C-1417 applied git-svn-id: http://svn.apache.org/repos/asf/axis/axis2/c/core/trunk@961429 13f79535-47bb-0310-9956-ffa450edef68 --- .../transport/http/util/http_transport_utils.c | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/core/transport') diff --git a/src/core/transport/http/util/http_transport_utils.c b/src/core/transport/http/util/http_transport_utils.c index 552cde5..90acc60 100644 --- a/src/core/transport/http/util/http_transport_utils.c +++ b/src/core/transport/http/util/http_transport_utils.c @@ -3256,7 +3256,37 @@ axis2_http_transport_utils_send_mtom_message( AXIS2_FREE(env->allocator, output_buffer); fclose(f); } + else if((mime_part->type) == AXIOM_MIME_PART_HANDLER) + { + void *handler_data = NULL; + axiom_mtom_sending_callback_t *callback = NULL; + + status = mime_part->read_handler_create(&callback, env); + + if(callback) + { + handler_data = AXIOM_MTOM_SENDING_CALLBACK_INIT_HANDLER(callback, env, + mime_part->user_param); + + if (handler_data) + { + status = axis2_http_transport_utils_send_attachment_using_callback(env, + chunked_stream, callback, handler_data, mime_part->user_param); + } + else + { + AXIS2_LOG_ERROR(env->log, AXIS2_LOG_SI, "MTOM Sending Handler loading failed"); + status = AXIS2_FAILURE; + } + mime_part->read_handler_remove(callback, env); + } + + if(status == AXIS2_FAILURE) + { + return status; + } + } /* if the callback is given, send data using callback */ else if((mime_part->type) == AXIOM_MIME_PART_CALLBACK) { -- cgit v1.1-32-gdbae