#include "jabberd.h"| typedef struct deliver_mp_st _deliver_msg |
| typedef struct ilist_struct _ilist |
| typedef struct deliver_mp_st* deliver_msg |
| typedef struct ilist_struct * ilist |
deliver a dpacket to an instance using the configured XML routings
| p | the packet that should be delivered (packet gets consumed) | |
| i | the instance of the sender (!) of the packet |
References deliver(), deliver__flag, deliver__mp, deliver_instance(), dpacket_struct::host, deliver_mp_st::i, log_debug2, LOGT_DELIVER, deliver_mp_st::p, p_LOG, p_NORM, p_XDB, pmalloco(), dpacket_struct::type, dpacket_struct::x, xhash_walk(), xmlnode_get_attrib_ns(), xmlnode_pool(), xmlnode_serialize_string(), and ZONE.
Referenced by _js_routed_auth_packet(), _js_routed_session_control_packet(), _js_routed_session_packet(), deliver(), deliver_fail(), dialback_in_read_db(), dialback_miod_read(), dnsrv_resend(), js_authreg(), js_deliver(), js_session_route(), log_generic(), logger(), main(), and xdb_file_phandler().
| void deliver_fail | ( | dpacket | p, | |
| const char * | err | |||
| ) |
bounce on the delivery, use the result to better gague what went wrong
References deliver(), dpacket_new(), dpacket_struct::host, j_strcmp(), jutil_error_xmpp(), jutil_tofrom(), log_debug2, log_notice(), log_warn(), LOGT_DELIVER, MAX_LOG_SIZE, messages_get(), xterror_struct::msg, NS_JABBERD_ERRMSG, NS_SESSION, dpacket_struct::p, p_LOG, p_NORM, p_ROUTE, p_XDB, pool_free(), dpacket_struct::type, dpacket_struct::x, xmlnode_get_attrib_ns(), xmlnode_get_firstchild(), xmlnode_get_lang(), xmlnode_get_namespace(), xmlnode_hide(), xmlnode_insert_tag_ns(), xmlnode_put_attrib_ns(), xmlnode_serialize_string(), XTERROR_EXTERNAL, and ZONE.
Referenced by _dialback_out_beat_packets(), _dnsrv_beat_packets(), _js_routed_packet(), deliver_instance(), dialback_out_connection_cleanup(), and dnsrv_lookup().
| instance deliver_hostcheck | ( | char const * | host | ) |
util to check and see which instance this hostname is going to get mapped to for normal packets
| host | the hostname to get checked |
References ilist_struct::i, and ilist_struct::next.
| void deliver_init | ( | pool | p | ) |
initialize the XML delivery system
| p | memory pool that can be used to register config handlers (must be available for the livetime of jabberd) |
References register_config(), and xhash_new().
Referenced by main().
actually perform the delivery to an instance
| i | the instance to deliver to | |
| p | the packet that gets delivered (packet gets consumed) |
References handel_struct::arg, deliver_fail(), dpacket_copy(), handel_struct::f, instance_struct::hds, instance_struct::id, log_debug2, LOGT_DELIVER, N_, handel_struct::next, handel_struct::o, o_COND, o_DELIVER, handel_struct::p, dpacket_struct::p, pool_free(), r_DONE, r_ERR, r_LAST, r_UNREG, and ZONE.
Referenced by deliver().
| bool deliver_is_uplink | ( | instance | i | ) |
checks if an instance is configured to be the uplink
| i | the instance to check |
| void deliver_pool_debug | ( | ) |
Referenced by main().
get list of hosts with explicit routing
| type | the type to get the routing for | |
| i | the instance to exclude from the result (NULL for not excluding any instance) |
References deliver_routed_hosts_walk_args::i, deliver_routed_hosts_walk_args::result, and xhash_walk().
| void deliver_shutdown | ( | void | ) |
free the delivery structures ... this is called when we already have shutdown the server therefore we cannot register it with register_shutdown()
References xhash_free().
Referenced by main().
create a clone of a deliverable packet
References dpacket_new(), dpacket_struct::x, and xmlnode_dup().
Referenced by deliver_instance().
create a new deliverable packet out of an xmlnode
| x | the xmlnode to generate the deliverable packet for |
References xmppd::jabberid::get_domain(), dpacket_struct::host, dpacket_struct::id, jid_new(), log_warn(), dpacket_struct::p, p_LOG, p_NONE, p_NORM, p_ROUTE, p_XDB, pmalloco(), pstrdup(), dpacket_struct::type, dpacket_struct::x, xmlnode_free(), xmlnode_get_attrib_ns(), xmlnode_get_localname(), xmlnode_pool(), and xmlnode_serialize_string().
Referenced by _dialback_out_beat_packets(), _js_routed_auth_packet(), _js_routed_packet(), _js_routed_session_control_packet(), _js_routed_session_packet(), xmppd::instance_base::deliver(), deliver_fail(), dialback_in_read_db(), dialback_miod_read(), dialback_out_connection_cleanup(), dnsrv_resend(), dpacket_copy(), js_authreg(), js_deliver(), js_session_route(), log_generic(), logger(), and xdb_file_phandler().
| void register_instance | ( | instance | i, | |
| char const * | host | |||
| ) |
register this instance as a possible recipient of packets to this host
| i | the instance to register | |
| host | the domain to register this instance for (or "*" to register as the default routing) |
References register_notifier_struct::arg, register_notifier_struct::callback, instance_struct::id, log_debug2, LOGT_REGISTER, register_notifier_struct::next, NS_JABBERD_CONFIGFILE, instance_struct::p, p_LOG, p_XDB, pstrdup(), instance_struct::routing_update_callbacks, instance_struct::type, instance_struct::x, xhash_free(), xhash_get(), xhash_new(), xhash_put(), xmlnode_get_list_item(), xmlnode_get_tags(), and ZONE.
Referenced by dialback_miod_hash(), and dialback_out_packet().
register a function to handle delivery for this instance
References handel_struct::arg, handel_struct::f, instance_struct::hds, handel_struct::next, handel_struct::o, o_COND, o_DELIVER, o_PRECOND, o_PREDELIVER, handel_struct::p, pmalloco(), and pool_new.
Referenced by dialback(), dnsrv(), xmppd::instance_base::instance_base(), jsm(), pthsock_client(), xdb_cache(), xdb_file(), and xdb_sql().
| void register_routing_update_callback | ( | instance | i, | |
| register_notify | f, | |||
| void * | arg | |||
| ) |
register a function that gets called on registering/unregistering a host for an instance
| i | the instance to get register/unregister events for (NULL for a global registration) | |
| f | the callback method to call | |
| arg | argument to pass to the callback |
References register_notifier_struct::arg, register_notifier_struct::callback, log_debug2, LOGT_EXECFLOW, register_notifier_struct::next, instance_struct::p, pmalloco(), pool_new, instance_struct::routing_update_callbacks, and ZONE.
Referenced by jsm().
| void unregister_instance | ( | instance | i, | |
| char const * | host | |||
| ) |
unregister an instance as a possible recipient of packets for a domain
| i | the instance to unregister | |
| host | the domain to unregister (or "*" to unregister as the default routing) |
References register_notifier_struct::arg, register_notifier_struct::callback, instance_struct::id, log_debug2, LOGT_REGISTER, register_notifier_struct::next, instance_struct::p, pstrdup(), instance_struct::routing_update_callbacks, instance_struct::type, xhash_get(), xhash_put(), xhash_zap(), and ZONE.
Referenced by _dialback_miod_hash_cleanup(), and instance_shutdown().
| int deliver__flag = 0 |
| xht deliver__hlog = NULL |
host filters for logging
| xht deliver__hnorm = NULL |
hosts for normal packets, important and most frequently used one
| xht deliver__hxdb = NULL |
host filters for xdb requests
| xht deliver__logtype = NULL |
log types, fixed set, but it's easier (wussier) to just be consistent and use a hashtable
| pth_msgport_t deliver__mp = NULL |
message port, that contains all queued messages for later delivery while deliver__flag = 0
Referenced by deliver().
| xht deliver__ns = NULL |
namespace filters for xdb
| instance deliver__uplink = NULL |
uplink instance, only one
list of callback functions, that should be called on all routing updates
| pool global_routing_update_pool = NULL |
memory pool to hold the entries in the global_routing_update_callbacks list
1.5.5