/* Run the queue service routines until there is no more work to be done. If flags & HTTP_BLOCK, this routine may block while yielding. Return true if actual work was done. */ PUBLIC bool httpServiceQueues(HttpConn *conn, int flags) { HttpQueue *q; bool workDone; workDone = 0; while (conn->state < HTTP_STATE_COMPLETE && (q = httpGetNextQueueForService(conn->serviceq)) != NULL) { if (q->servicing) { /* Called re-entrantly */ q->flags |= HTTP_QUEUE_RESERVICE; } else { assert(q->schedulePrev == q->scheduleNext); httpServiceQueue(q); workDone = 1; } if (mprNeedYield() && (flags & HTTP_BLOCK)) { mprYield(0); } } /* Always do a yield if requested even if there are no queues to service */ if (mprNeedYield() && (flags & HTTP_BLOCK)) { mprYield(0); } return workDone; }
/* Run the queue service routines until there is no more work to be done. NOTE: all I/O is non-blocking. */ bool httpServiceQueues(HttpConn *conn) { HttpQueue *q; int workDone; workDone = 0; while (conn->state < HTTP_STATE_COMPLETE && (q = httpGetNextQueueForService(conn->serviceq)) != NULL) { if (q->servicing) { q->flags |= HTTP_QUEUE_RESERVICE; } else { mprAssert(q->schedulePrev == q->scheduleNext); httpServiceQueue(q); workDone = 1; } } return workDone; }