summaryrefslogtreecommitdiff
path: root/src/HttpServerBodyCommand.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/HttpServerBodyCommand.cc')
-rw-r--r--src/HttpServerBodyCommand.cc10
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 {