diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-10-03 17:59:39 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2015-10-03 17:59:39 +0900 |
| commit | c81b1321122e8509b55c94c0cbca0d8d6d319f0c (patch) | |
| tree | f24b49dd9cceb006172dbd09da4e5f5d3371241b /src/HttpServerBodyCommand.cc | |
| parent | c63fc414c389c893c80022669a7d75f3c6869c7e (diff) | |
| parent | 85faafcaf233855042aead1cc522375fa7955d7e (diff) | |
Merge branch 'master' into random-webseeding
Diffstat (limited to 'src/HttpServerBodyCommand.cc')
| -rw-r--r-- | src/HttpServerBodyCommand.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/HttpServerBodyCommand.cc b/src/HttpServerBodyCommand.cc index 8f5cac16..2f7bc7da 100644 --- a/src/HttpServerBodyCommand.cc +++ b/src/HttpServerBodyCommand.cc @@ -115,6 +115,10 @@ void HttpServerBodyCommand::sendJsonRpcResponse httpServer_->disableKeepAlive(); int httpCode; switch(res.code) { + case 1: + // error caught while executing RpcMethod + httpCode = 400; + break; case -32600: httpCode = 400; break; @@ -148,8 +152,8 @@ void HttpServerBodyCommand::addHttpServerResponseCommand(bool delayed) auto resp = make_unique<HttpServerResponseCommand>(getCuid(), httpServer_, e_, socket_); if (delayed) { - e_->addCommand( - make_unique<DelayedCommand>(getCuid(), e_, 1, std::move(resp), true)); + e_->addCommand(make_unique<DelayedCommand>( + getCuid(), e_, 1_s, std::move(resp), true)); return; } @@ -320,7 +324,7 @@ bool HttpServerBodyCommand::execute() return false; } } else { - if(timeoutTimer_.difference(global::wallclock()) >= 30) { + if(timeoutTimer_.difference(global::wallclock()) >= 30_s) { A2_LOG_INFO("HTTP request body timeout."); return true; } else { |
