Exemplo n.º 1
0
int engine_msg_process(tp_vtable_child_arg_t *c, int fd) {
    /* set_fl(fd, O_NONBLOCK); */

#if 0
    char buffer[1024 * 1024];/* 1MB */
    int    rv0= -1;
    int    rv = 0;

    char   sessionid[67] = "";
    session_gen(sessionid, sizeof(sessionid));/* 生成session id */
#endif

    struct engine_base *engine= NULL;
    tp_vtable_global_arg_t *g;
    g = c->global;
    engine = (struct engine_base *)g->consumer_arg;

#if 0
    for (;;) {
        rv0 = do_decode(fd, buffer, sizeof(buffer), msg.req, sessionid);
        if (rv0 == TASK_ERR || rv0 == TASK_EOF) {
            LOG_WARN("...do_decode:id = %s:rv0(%d) fd(%d)\n", sessionid, rv0, fd);
            return -1;
        }

        if (do_code(fd, buffer, sizeof(buffer), rv, msg.rsp, sessionid) == TASK_ERR) {
            LOG_WARN("...do_code:id =%s\n", sessionid);
            return -1;
        }


    }
#endif
    return 0;
}
Exemplo n.º 2
0
CLIP_DLLEXPORT int
_clip_code_func(ClipMachine * ClipMachineMemory, struct ClipBlock *cp, int argc, int rest, ClipVarFrame * uplocals)
{
   return do_code(ClipMachineMemory, cp, argc, 0, rest, uplocals);
}
Exemplo n.º 3
0
CLIP_DLLEXPORT int
_clip_code_proc(struct ClipMachine *mp, struct ClipBlock *cp, int argc, int rest, ClipVarFrame * uplocals)
{
	return do_code(mp, cp, argc, 1, rest, uplocals);
}