Author: billblough
Date: Sun May 6 02:45:21 2018
New Revision: 1831013
URL: http://svn.apache.org/viewvc?rev=1831013&view=rev
Log:
Apply http_transport_utils fixes from AXISC-1669
Modified:
axis/axis2/c/core/trunk/src/core/transport/http/util/http_transport_utils.c
Modified:
axis/axis2/c/core/trunk/src/core/transport/http/util/http_transport_utils.c
URL:
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/src/core/transport/http/util/http_transport_utils.c?rev=1831013&r1=1831012&r2=1831013&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/src/core/transport/http/util/http_transport_utils.c
(original)
+++ axis/axis2/c/core/trunk/src/core/transport/http/util/http_transport_utils.c
Sun May 6 02:45:21 2018
@@ -776,7 +776,11 @@ axis2_http_transport_utils_process_http_
soap_envelope =
axiom_soap_envelope_create_default_soap_envelope(env, AXIOM_SOAP11);
def_body = axiom_soap_envelope_get_body(soap_envelope, env);
om_doc = axiom_stax_builder_get_document(om_builder, env);
- root_node =
axiom_document_get_root_element(om_doc, env);
+ if (!om_doc)
+ return AXIS2_FAILURE;
+ root_node = axiom_document_get_root_element(om_doc, env);
+ if (!root_node)
+ return AXIS2_FAILURE;
root_node = axiom_document_build_all(om_doc, env);
axiom_soap_body_add_child(def_body, env, root_node);
}
@@ -1236,7 +1240,11 @@ axis2_http_transport_utils_process_http_
soap_envelope =
axiom_soap_envelope_create_default_soap_envelope(env, AXIOM_SOAP11);
def_body = axiom_soap_envelope_get_body(soap_envelope, env);
om_doc = axiom_stax_builder_get_document(om_builder, env);
- root_node =
axiom_document_get_root_element(om_doc, env);
+ if (!om_doc)
+ return AXIS2_FAILURE;
+ root_node = axiom_document_get_root_element(om_doc, env);
+ if (!root_node)
+ return AXIS2_FAILURE;
root_node = axiom_document_build_all(om_doc, env);
axiom_soap_body_add_child(def_body, env, root_node);
}
@@ -2428,10 +2436,26 @@ axis2_http_transport_utils_create_soap_m
soap_envelope = axiom_soap_envelope_create_default_soap_envelope(env,
AXIOM_SOAP11);
def_body = axiom_soap_envelope_get_body(soap_envelope, env);
om_doc = axiom_stax_builder_get_document(om_builder, env);
- root_node = axiom_document_get_root_element(om_doc, env);
- root_node = axiom_document_build_all(om_doc, env);
+ if (!om_doc)
+ return AXIS2_FAILURE;
+ root_node = axiom_document_get_root_element(om_doc, env);
+ if (!root_node)
+ return AXIS2_FAILURE;
+ root_node = axiom_document_build_all(om_doc, env);
axiom_soap_body_add_child(def_body, env, root_node);
axiom_stax_builder_free_self(om_builder, env);
+
+ if(stream)
+ {
+ axutil_stream_free(stream, env);
+ callback_ctx->in_stream = NULL;
+ }
+ if(callback_ctx->chunked_stream)
+ {
+ axutil_http_chunked_stream_free(callback_ctx->chunked_stream, env);
+ callback_ctx->chunked_stream = NULL;
+ }
+
}
return soap_envelope;