// Read from the socket
fetch = readWant_ - readBufferPos_;
got = recv(socket_, readBuffer_ + readBufferPos_, fetch, 0);
-
+
if (got > 0) {
// Move along in the buffer
readBufferPos_ += got;
// and get back some data from the dispatch function
inputTransport_->resetBuffer(readBuffer_, readBufferPos_);
outputTransport_->resetBuffer();
-
+
if (server_->isThreadPoolProcessing()) {
// We are setting up a Task to do this work and we will wait on it
int sv[2];
return;
}
server_->addTask(task);
+
+ // Set this connection idle so that libevent doesn't process more
+ // data on it while we're still waiting for the threadmanager to
+ // finish this task
+ setIdle();
return;
}
} else {
}
}
+ // Intentionally fall through here, the call to process has written into
+ // the writeBuffer_
+
case APP_WAIT_TASK:
// We have now finished processing a task and the result has been written
// into the outputTransport_, so we grab its contents and place them into
// Update in memory structure
eventFlags_ = eventFlags;
+ // Do not call event_set if there are no flags
+ if (!eventFlags_) {
+ return;
+ }
+
/**
* event_set:
*