src/libmetha/worker.c
M_CODE
lm_worker_run_once(worker_t *w)
{
    if (lm_worker_init(w) != M_OK) {
        LM_ERROR(w->m, "worker initialization failed");
        return M_FAILED;
    }

    if (w->crawler->initial_filetype.ptr) {
        ulist_t *t = lm_utable_top(&w->ue_h->primary);
        t->row[t->sz-1].bind = w->crawler->initial_filetype.ptr->id;
        w->crawler->initial_filetype.ptr = 0;
    } else
        lm_worker_sort(w);

    ue_next(w->ue_h);
    lm_worker_perform(w);
    lm_worker_sort(w);

    return M_OK;
}
/** 
 * Run once without launching a new thread.
 *
 * See lmetha_exec_once() and lmetha_exec_provided().
 **/
Run once without launching a new thread.
Run once without launching a new thread .
M_CODE
lm_worker_run_once(worker_t *w)
{
    if (lm_worker_init(w) != M_OK) {
        LM_ERROR(w->m, "worker initialization failed");
        return M_FAILED;
    }
    if (w->crawler->initial_filetype.ptr) {
        ulist_t *t = lm_utable_top(&w->ue_h->primary);
        t->row[t->sz-1].bind = w->crawler->initial_filetype.ptr->id;
        w->crawler->initial_filetype.ptr = 0;
    } else
        lm_worker_sort(w);
    ue_next(w->ue_h);
    lm_worker_perform(w);
    lm_worker_sort(w);
    return M_OK;
}
M_CODE lm_worker_run_once ( worker_t * w ) { if ( lm_worker_init ( w ) != M_OK ) { LM_ERROR ( w -> m , " " ) ; return M_FAILED ; } if ( w -> crawler -> initial_filetype . ptr ) { ulist_t * t = lm_utable_top ( & w -> ue_h -> primary ) ; t -> row [ t -> sz - 1 ] . bind = w -> crawler -> initial_filetype . ptr -> id ; w -> crawler -> initial_filetype . ptr = 0 ; } else lm_worker_sort ( w ) ; ue_next ( w -> ue_h ) ; lm_worker_perform ( w ) ; lm_worker_sort ( w ) ; return M_OK ; }
Run once without launching a new thread.
Run once without launching a new thread .