Ejemplo n.º 1
0
int main(int argc, char **argv)
{
    YAZ_CHECK_INIT(argc, argv);

    yaz_log_xml_errors(0, 0 /* disable it */);

#if YAZ_HAVE_XSLT
    tst_configure();
#endif
    YAZ_CHECK_TERM;
}
Ejemplo n.º 2
0
int main(int argc, char **argv)
{
    YAZ_CHECK_INIT(argc, argv);
    yaz_log_xml_errors(0, 0 /* disable log */);
#if YAZ_HAVE_XML2
    tst_configure();
#endif
#if YAZ_HAVE_XSLT
    tst_convert1();
    tst_convert2();
    tst_convert3();
    tst_convert4();
#endif
    YAZ_CHECK_TERM;
}
Ejemplo n.º 3
0
static void *new_session(void *vp)
{
    char *a;
    association *newas;
    IOCHAN new_chan;
    COMSTACK new_line = (COMSTACK) vp;
    IOCHAN parent_chan = (IOCHAN) new_line->user;

    unsigned cs_get_mask, cs_accept_mask, mask =  
        ((new_line->io_pending & CS_WANT_WRITE) ? EVENT_OUTPUT : 0) |
        ((new_line->io_pending & CS_WANT_READ) ? EVENT_INPUT : 0);

    if (mask)
    {
        cs_accept_mask = mask;  /* accept didn't complete */
        cs_get_mask = 0;
    }
    else
    {
        cs_accept_mask = 0;     /* accept completed.  */
        cs_get_mask = mask = EVENT_INPUT;
    }

    if (!(new_chan = iochan_create(cs_fileno(new_line), ir_session, mask,
                                   parent_chan->chan_id)))
    {
        yaz_log(YLOG_FATAL, "Failed to create iochan");
        return 0;
    }
    if (!(newas = create_association(new_chan, new_line,
                                     control_block.apdufile)))
    {
        yaz_log(YLOG_FATAL, "Failed to create new assoc.");
        return 0;
    }
    newas->cs_accept_mask = cs_accept_mask;
    newas->cs_get_mask = cs_get_mask;

    iochan_setdata(new_chan, newas);
    iochan_settimeout(new_chan, 60);
#if 1
    a = cs_addrstr(new_line);
#else
    a = 0;
#endif
    yaz_log_xml_errors(0, YLOG_WARN);
    yaz_log(log_session, "Session - OK %d %s %ld",
            no_sessions, a ? a : "[Unknown]", (long) getpid());
    if (max_sessions && no_sessions >= max_sessions)
        control_block.one_shot = 1;
    if (control_block.threads)
    {
        iochan_event_loop(&new_chan);
    }
    else
    {
        new_chan->next = pListener;
        pListener = new_chan;
    }
    return 0;
}