Exemplo n.º 1
0
static void empty_msg_lists(void)
{
    Msg *msg;

#ifndef NO_WAP
    if (gwlist_len(incoming_wdp) > 0 || gwlist_len(outgoing_wdp) > 0)
        warning(0, "Remaining WDP: %ld incoming, %ld outgoing",
                gwlist_len(incoming_wdp), gwlist_len(outgoing_wdp));

    info(0, "Total WDP messages: received %ld, sent %ld",
         counter_value(incoming_wdp_counter),
         counter_value(outgoing_wdp_counter));
#endif
    
    while ((msg = gwlist_extract_first(incoming_wdp)) != NULL)
        msg_destroy(msg);
    while ((msg = gwlist_extract_first(outgoing_wdp)) != NULL)
        msg_destroy(msg);

    gwlist_destroy(incoming_wdp, NULL);
    gwlist_destroy(outgoing_wdp, NULL);

    counter_destroy(incoming_wdp_counter);
    counter_destroy(outgoing_wdp_counter);
    
#ifndef NO_SMS
    /* XXX we should record these so that they are not forever lost... */
    if (gwlist_len(incoming_sms) > 0 || gwlist_len(outgoing_sms) > 0)
        debug("bb", 0, "Remaining SMS: %ld incoming, %ld outgoing",
              gwlist_len(incoming_sms), gwlist_len(outgoing_sms));

    info(0, "Total SMS messages: received %ld, dlr %ld, sent %ld, dlr %ld",
         counter_value(incoming_sms_counter),
         counter_value(incoming_dlr_counter),
         counter_value(outgoing_sms_counter),
         counter_value(outgoing_dlr_counter));
#endif

    gwlist_destroy(incoming_sms, msg_destroy_item);
    gwlist_destroy(outgoing_sms, msg_destroy_item);
    
    counter_destroy(incoming_sms_counter);
    counter_destroy(incoming_dlr_counter);
    counter_destroy(outgoing_sms_counter);
    counter_destroy(outgoing_dlr_counter);

    load_destroy(incoming_sms_load);
    load_destroy(incoming_dlr_load);
    load_destroy(outgoing_sms_load);
    load_destroy(outgoing_dlr_load);
}
Exemplo n.º 2
0
int smscconn_destroy(SMSCConn *conn)
{
    if (conn == NULL)
	return 0;
    if (conn->status != SMSCCONN_DEAD)
	return -1;
    mutex_lock(conn->flow_mutex);

    counter_destroy(conn->received);
    counter_destroy(conn->received_dlr);
    counter_destroy(conn->sent);
    counter_destroy(conn->sent_dlr);
    counter_destroy(conn->failed);

    load_destroy(conn->incoming_sms_load);
    load_destroy(conn->incoming_dlr_load);
    load_destroy(conn->outgoing_sms_load);
    load_destroy(conn->outgoing_dlr_load);

    octstr_destroy(conn->name);
    octstr_destroy(conn->id);
    octstr_destroy(conn->admin_id);
    gwlist_destroy(conn->allowed_smsc_id, octstr_destroy_item);
    gwlist_destroy(conn->denied_smsc_id, octstr_destroy_item);
    gwlist_destroy(conn->preferred_smsc_id, octstr_destroy_item);
    octstr_destroy(conn->denied_prefix);
    octstr_destroy(conn->allowed_prefix);
    octstr_destroy(conn->preferred_prefix);
    octstr_destroy(conn->unified_prefix);
    octstr_destroy(conn->our_host);
    octstr_destroy(conn->log_file);

    if (conn->denied_smsc_id_regex != NULL) gw_regex_destroy(conn->denied_smsc_id_regex);
    if (conn->allowed_smsc_id_regex != NULL) gw_regex_destroy(conn->allowed_smsc_id_regex);
    if (conn->preferred_prefix_regex != NULL) gw_regex_destroy(conn->preferred_prefix_regex);
    if (conn->denied_prefix_regex != NULL) gw_regex_destroy(conn->denied_prefix_regex);
    if (conn->allowed_prefix_regex != NULL) gw_regex_destroy(conn->allowed_prefix_regex);

    octstr_destroy(conn->reroute_to_smsc);
    dict_destroy(conn->reroute_by_receiver);

    mutex_unlock(conn->flow_mutex);
    mutex_destroy(conn->flow_mutex);

    gw_free(conn);
    return 0;
}
Exemplo n.º 3
0
JPEG_NODE *jpeg_create_link(PFBDEV pfbdev, JPEG_NODE *jpeg_head, const char *path)
{
    FILE_NODE *jpeg_file_head = NULL;

    jpeg_file_head = load_init(jpeg_file_head, ".jpg", path);

    while (jpeg_file_head != NULL) 
    {
        jpeg_head = jpeg_link_add(pfbdev, jpeg_head, jpeg_file_head->flname);
        jpeg_file_head = jpeg_file_head->next;
    }

    load_destroy(jpeg_file_head);
    
    return jpeg_head;
}