1
0
Fork 0

pass startTime into processRead

This commit is contained in:
Jan Christoph Uhde 2016-11-23 14:06:36 +01:00
parent bac0bc2222
commit b40a18aac1
6 changed files with 10 additions and 9 deletions

View File

@ -187,7 +187,7 @@ void HttpCommTask::addResponse(HttpResponse* response) {
} }
// reads data from the socket // reads data from the socket
bool HttpCommTask::processRead() { bool HttpCommTask::processRead(double startTime) {
cancelKeepAlive(); cancelKeepAlive();
TRI_ASSERT(_readBuffer.c_str() != nullptr); TRI_ASSERT(_readBuffer.c_str() != nullptr);
@ -271,7 +271,7 @@ bool HttpCommTask::processRead() {
GeneralServerFeature::keepAliveTimeout(), /*skipSocketInit*/ true); GeneralServerFeature::keepAliveTimeout(), /*skipSocketInit*/ true);
commTask->addToReadBuffer(_readBuffer.c_str() + 11, commTask->addToReadBuffer(_readBuffer.c_str() + 11,
_readBuffer.length() - 11); _readBuffer.length() - 11);
commTask->processRead(); commTask->processRead(startTime);
commTask->start(); commTask->start();
// statistics?! // statistics?!
return false; return false;

View File

@ -36,7 +36,7 @@ class HttpCommTask : public GeneralCommTask {
}; };
protected: protected:
bool processRead() override; bool processRead(double startTime) override;
std::unique_ptr<GeneralResponse> createResponse( std::unique_ptr<GeneralResponse> createResponse(
rest::ResponseCode, uint64_t messageId) override final; rest::ResponseCode, uint64_t messageId) override final;

View File

@ -220,7 +220,7 @@ void VppCommTask::handleAuthentication(VPackSlice const& header,
} }
// reads data from the socket // reads data from the socket
bool VppCommTask::processRead() { bool VppCommTask::processRead(double startTime) {
RequestStatisticsAgent agent(true); RequestStatisticsAgent agent(true);
auto& prv = _processReadVariables; auto& prv = _processReadVariables;

View File

@ -61,7 +61,7 @@ class VppCommTask : public GeneralCommTask {
protected: protected:
// read data check if chunk and message are complete // read data check if chunk and message are complete
// if message is complete execute a request // if message is complete execute a request
bool processRead() override; bool processRead(double startTime) override;
std::unique_ptr<GeneralResponse> createResponse( std::unique_ptr<GeneralResponse> createResponse(
rest::ResponseCode, uint64_t messageId) override final; rest::ResponseCode, uint64_t messageId) override final;

View File

@ -401,8 +401,8 @@ void SocketTask::asyncReadSome() {
continue; continue;
} }
double start_time = TRI_StatisticsTime();
while (processRead()) { while (processRead(start_time)) {
if (_abandoned) { if (_abandoned) {
return; return;
} }
@ -453,7 +453,8 @@ void SocketTask::asyncReadSome() {
_readBuffer.increaseLength(transferred); _readBuffer.increaseLength(transferred);
while (processRead()) { double start_time = TRI_StatisticsTime();
while (processRead(start_time)) {
if (_closeRequested) { if (_closeRequested) {
break; break;
} }

View File

@ -64,7 +64,7 @@ class SocketTask : virtual public Task, public ConnectionStatisticsAgent {
void start(); void start();
protected: protected:
virtual bool processRead() = 0; virtual bool processRead(double start_time) = 0;
// This function is used during the protocol switch from http // This function is used during the protocol switch from http
// to VelocyStream. This way we no not require additional // to VelocyStream. This way we no not require additional