mirror of https://gitee.com/bigwinds/arangodb
pass startTime into processRead
This commit is contained in:
parent
bac0bc2222
commit
b40a18aac1
|
@ -187,7 +187,7 @@ void HttpCommTask::addResponse(HttpResponse* response) {
|
|||
}
|
||||
|
||||
// reads data from the socket
|
||||
bool HttpCommTask::processRead() {
|
||||
bool HttpCommTask::processRead(double startTime) {
|
||||
cancelKeepAlive();
|
||||
|
||||
TRI_ASSERT(_readBuffer.c_str() != nullptr);
|
||||
|
@ -271,7 +271,7 @@ bool HttpCommTask::processRead() {
|
|||
GeneralServerFeature::keepAliveTimeout(), /*skipSocketInit*/ true);
|
||||
commTask->addToReadBuffer(_readBuffer.c_str() + 11,
|
||||
_readBuffer.length() - 11);
|
||||
commTask->processRead();
|
||||
commTask->processRead(startTime);
|
||||
commTask->start();
|
||||
// statistics?!
|
||||
return false;
|
||||
|
|
|
@ -36,7 +36,7 @@ class HttpCommTask : public GeneralCommTask {
|
|||
};
|
||||
|
||||
protected:
|
||||
bool processRead() override;
|
||||
bool processRead(double startTime) override;
|
||||
|
||||
std::unique_ptr<GeneralResponse> createResponse(
|
||||
rest::ResponseCode, uint64_t messageId) override final;
|
||||
|
|
|
@ -220,7 +220,7 @@ void VppCommTask::handleAuthentication(VPackSlice const& header,
|
|||
}
|
||||
|
||||
// reads data from the socket
|
||||
bool VppCommTask::processRead() {
|
||||
bool VppCommTask::processRead(double startTime) {
|
||||
RequestStatisticsAgent agent(true);
|
||||
|
||||
auto& prv = _processReadVariables;
|
||||
|
|
|
@ -61,7 +61,7 @@ class VppCommTask : public GeneralCommTask {
|
|||
protected:
|
||||
// read data check if chunk and message are complete
|
||||
// if message is complete execute a request
|
||||
bool processRead() override;
|
||||
bool processRead(double startTime) override;
|
||||
|
||||
std::unique_ptr<GeneralResponse> createResponse(
|
||||
rest::ResponseCode, uint64_t messageId) override final;
|
||||
|
|
|
@ -401,8 +401,8 @@ void SocketTask::asyncReadSome() {
|
|||
|
||||
continue;
|
||||
}
|
||||
|
||||
while (processRead()) {
|
||||
double start_time = TRI_StatisticsTime();
|
||||
while (processRead(start_time)) {
|
||||
if (_abandoned) {
|
||||
return;
|
||||
}
|
||||
|
@ -453,7 +453,8 @@ void SocketTask::asyncReadSome() {
|
|||
|
||||
_readBuffer.increaseLength(transferred);
|
||||
|
||||
while (processRead()) {
|
||||
double start_time = TRI_StatisticsTime();
|
||||
while (processRead(start_time)) {
|
||||
if (_closeRequested) {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ class SocketTask : virtual public Task, public ConnectionStatisticsAgent {
|
|||
void start();
|
||||
|
||||
protected:
|
||||
virtual bool processRead() = 0;
|
||||
virtual bool processRead(double start_time) = 0;
|
||||
|
||||
// This function is used during the protocol switch from http
|
||||
// to VelocyStream. This way we no not require additional
|
||||
|
|
Loading…
Reference in New Issue