Logo Search packages:      
Sourcecode: jabberd2 version File versions  Download package

mod_ret_t mm_pkt_router ( mm_t  mm,
pkt_t  pkt 
)

fire pkt-router chain

packets from the router

Definition at line 592 of file mm.c.

References mod_instance_st::mod, mod_PASS, module_st::name, mm_st::npkt_router, module_st::pkt_router, and mm_st::pkt_router.

Referenced by dispatch().

                                            {
    int n;
    mod_instance_t mi;
    mod_ret_t ret = mod_PASS;

    log_debug(ZONE, "dispatching pkt-router chain");

    for(n = 0; n < mm->npkt_router; n++) {
        mi = mm->pkt_router[n];
        if(mi == NULL || mi->mod->pkt_router == NULL) {
            log_debug(ZONE, "module %s has no handler for this chain", mi->mod->name);
            continue;
        }

        log_debug(ZONE, "calling module %s", mi->mod->name);

        ret = (mi->mod->pkt_router)(mi, pkt);
        if(ret != mod_PASS)
            break;
    }

    log_debug(ZONE, "pkt-router chain returning %d", ret);

    return ret;
}


Generated by  Doxygen 1.6.0   Back to index