PUBLIC void mprEnableCmdOutputEvents(MprCmd *cmd, bool on) { int mask; mask = on ? MPR_READABLE : 0; if (cmd->handlers[MPR_CMD_STDOUT]) { mprWaitOn(cmd->handlers[MPR_CMD_STDOUT], mask); } if (cmd->handlers[MPR_CMD_STDERR]) { mprWaitOn(cmd->handlers[MPR_CMD_STDERR], mask); } }
PUBLIC void mprEnableCmdEvents(MprCmd *cmd, int channel) { int mask = (channel == MPR_CMD_STDIN) ? MPR_WRITABLE : MPR_READABLE; if (cmd->handlers[channel]) { mprWaitOn(cmd->handlers[channel], mask); } }
PUBLIC void httpSetupWaitHandler(HttpConn *conn, int eventMask) { MprSocket *sp; sp = conn->sock; if (eventMask) { if (sp->handler == 0) { mprAddSocketHandler(sp, eventMask, conn->dispatcher, conn->ioCallback, conn, 0); } else { mprSetSocketDispatcher(sp, conn->dispatcher); mprEnableSocketEvents(sp, eventMask); } } else if (sp->handler) { mprWaitOn(sp->handler, eventMask); } }
PUBLIC void mprDisableCmdEvents(MprCmd *cmd, int channel) { if (cmd->handlers[channel]) { mprWaitOn(cmd->handlers[channel], 0); } }