<commit_before>/*
 * Copyright 2004,2005 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <axis2_addr_mod.h>
#include <axis2_addr.h>
#include <axis2_handler_desc.h>
#include <axis2_array_list.h>
#include <axis2_soap_envelope.h>
#include <axis2_soap_header.h>
#include <axis2_soap_header_block.h>
#include <axis2_op.h>
#include <axis2_msg_ctx.h>
#include <axis2_msg_info_headers.h>
#include <axis2_property.h>

axis2_status_t AXIS2_CALL
axis2_addr_in_handler_invoke(struct axis2_handler *handler, 
                         axis2_env_t **env,
                         struct axis2_msg_ctx *msg_ctx);
                                             
axis2_bool_t 
axis2_addr_in_check_element(axis2_env_t **env, axis2_qname_t *expected_qname,
              axis2_qname_t *actual_qname);
                         
axis2_status_t 
axis2_addr_in_extract_svc_grp_ctx_id(axis2_env_t **env, 
                       axis2_soap_header_t *soap_header, 
                       axis2_msg_ctx_t *msg_ctx);
                         
axis2_status_t
axis2_addr_in_extract_ref_params(axis2_env_t **env,
                   axis2_soap_header_t *soap_header,
                   axis2_msg_info_headers_t *msg_info_headers);
                            
axis2_status_t 
axis2_addr_in_extract_addr_final_info(axis2_env_t **env,
                        axis2_soap_header_t *soap_header,
                        axis2_msg_info_headers_t **msg_info_headers,
                        axis2_array_list_t *addr_headers);
                         
                         
axis2_status_t 
axis2_addr_in_extract_to_epr_ref_params(axis2_env_t **env,
                          axis2_endpoint_ref_t * to_epr,
                          axis2_soap_header_t *soap_header,
                          axis2_char_t *addr_ns);
                          
axis2_status_t 
axis2_addr_in_extract_epr_information(axis2_env_t **env,
                        axis2_soap_header_block_t *soap_header_block,
                        axis2_endpoint_ref_t *endpoint_ref,
                        axis2_char_t *addr_ns);
                        
axis2_status_t
axis2_addr_in_extract_addr_params(axis2_env_t **env,
                    axis2_soap_header_t *soap_header,
                    axis2_msg_info_headers_t **msg_info_headers,
                    axis2_array_list_t *addr_headers,
                    axis2_char_t *addr_ns);

axis2_status_t axis2_addr_in_extract_addr_submission_info(axis2_env_t **env,
        axis2_soap_header_t *soap_header,
        axis2_msg_info_headers_t **msg_info_headers,
        axis2_array_list_t *addr_headers);

/******************************************************************************/                         

AXIS2_DECLARE(axis2_handler_t*)
axis2_addr_in_handler_create(axis2_env_t **env, 
                         axis2_qname_t *qname) 
{
    axis2_handler_t *handler = NULL;
    axis2_handler_desc_t *handler_desc = NULL;
    axis2_qname_t *handler_qname = NULL;
    
    AXIS2_ENV_CHECK(env, NULL);
    
    if (qname)
    {
        handler_qname = AXIS2_QNAME_CLONE(qname, env);
        if (!(handler_qname))
        {
            AXIS2_ERROR_SET((*env)->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE);
            return NULL;        
        }
    }
    else
    {
        /* create default qname */
        handler_qname = axis2_qname_create(env, "addr_in_handler", 
                                                "http://axis.ws.apache.org",
                                                NULL);
        if (!handler_qname)
        {
            return NULL;        
        }           
    }
    
    handler = axis2_handler_create(env);
    if (!handler)
    {
        return NULL;
    }
    
    /* handler desc of base handler */
    /*handler_desc = axis2_handler_desc_create_with_qname(env, handler_qname);
    if (!handler_desc)
    {
        AXIS2_HANDLER_FREE(handler, env);
        return NULL;
    }
    
    AXIS2_HANDLER_INIT(handler, env, handler_desc);
    */
    
    /* set the base struct's invoke op */
    if (handler->ops) 
        handler->ops->invoke = axis2_addr_in_handler_invoke;

    return handler;
}


axis2_status_t AXIS2_CALL
axis2_addr_in_handler_invoke(struct axis2_handler *handler, 
                         axis2_env_t **env,
                         struct axis2_msg_ctx *msg_ctx)
{
    axis2_soap_envelope_t *soap_envelope = NULL;
    axis2_soap_header_t *soap_header = NULL;
    axis2_property_t *property = NULL;<commit_msg>More memory leak fixes<commit_after>/*
 * Copyright 2004,2005 The Apache Software Foundation.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <axis2_addr_mod.h>
#include <axis2_addr.h>
#include <axis2_handler_desc.h>
#include <axis2_array_list.h>
#include <axis2_soap_envelope.h>
#include <axis2_soap_header.h>
#include <axis2_soap_header_block.h>
#include <axis2_op.h>
#include <axis2_msg_ctx.h>
#include <axis2_msg_info_headers.h>
#include <axis2_property.h>

axis2_status_t AXIS2_CALL
axis2_addr_in_handler_invoke(struct axis2_handler *handler, 
                         axis2_env_t **env,
                         struct axis2_msg_ctx *msg_ctx);
                                             
axis2_bool_t 
axis2_addr_in_check_element(axis2_env_t **env, axis2_qname_t *expected_qname,
              axis2_qname_t *actual_qname);
                         
axis2_status_t 
axis2_addr_in_extract_svc_grp_ctx_id(axis2_env_t **env, 
                       axis2_soap_header_t *soap_header, 
                       axis2_msg_ctx_t *msg_ctx);
                         
axis2_status_t
axis2_addr_in_extract_ref_params(axis2_env_t **env,
                   axis2_soap_header_t *soap_header,
                   axis2_msg_info_headers_t *msg_info_headers);
                            
axis2_status_t 
axis2_addr_in_extract_addr_final_info(axis2_env_t **env,
                        axis2_soap_header_t *soap_header,
                        axis2_msg_info_headers_t **msg_info_headers,
                        axis2_array_list_t *addr_headers);
                         
                         
axis2_status_t 
axis2_addr_in_extract_to_epr_ref_params(axis2_env_t **env,
                          axis2_endpoint_ref_t * to_epr,
                          axis2_soap_header_t *soap_header,
                          axis2_char_t *addr_ns);
                          
axis2_status_t 
axis2_addr_in_extract_epr_information(axis2_env_t **env,
                        axis2_soap_header_block_t *soap_header_block,
                        axis2_endpoint_ref_t *endpoint_ref,
                        axis2_char_t *addr_ns);
                        
axis2_status_t
axis2_addr_in_extract_addr_params(axis2_env_t **env,
                    axis2_soap_header_t *soap_header,
                    axis2_msg_info_headers_t **msg_info_headers,
                    axis2_array_list_t *addr_headers,
                    axis2_char_t *addr_ns);

axis2_status_t axis2_addr_in_extract_addr_submission_info(axis2_env_t **env,
        axis2_soap_header_t *soap_header,
        axis2_msg_info_headers_t **msg_info_headers,
        axis2_array_list_t *addr_headers);

/******************************************************************************/                         

AXIS2_DECLARE(axis2_handler_t*)
axis2_addr_in_handler_create(axis2_env_t **env, 
                         axis2_qname_t *qname) 
{
    axis2_handler_t *handler = NULL;
    
    AXIS2_ENV_CHECK(env, NULL);
    
    handler = axis2_handler_create(env);
    if (!handler)
    {
        return NULL;
    }
   
    /* handler init is handled by conf loading, so no need to do it here */
    
    /* set the base struct's invoke op */
    if (handler->ops) 
        handler->ops->invoke = axis2_addr_in_handler_invoke;

    return handler;
}


axis2_status_t AXIS2_CALL
axis2_addr_in_handler_invoke(struct axis2_handler *handler, 
                         axis2_env_t **env,
                         struct axis2_msg_ctx *msg_ctx)
{
    axis2_soap_envelope_t *soap_envelope = NULL;
    axis2_soap_header_t *soap_header = NULL;
    axis2_property_t *property = NULL;
{'fraction_non_alphanumeric': 0.08218428540161961, 'fraction_numerical': 0.02144889472532283, 'mean_word_length': 2.189877835951134, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '954026', 'n_tokens_mistral': 2938, 'n_tokens_neox': 2837, 'n_words': 528}