[REST] give an appropriate response in warmup phase

This commit is contained in:
Jonas Schnelli
2014-11-26 13:51:02 +01:00
parent 210eba9fdb
commit 78bdc8103f
4 changed files with 16 additions and 0 deletions

View File

@@ -188,6 +188,10 @@ bool HTTPReq_REST(AcceptedConnection *conn,
bool fRun)
{
try {
std::string statusmessage;
if(RPCIsInWarmup(&statusmessage))
throw RESTERR(HTTP_SERVICE_UNAVAILABLE, "Service temporarily unavailable: "+statusmessage);
for (unsigned int i = 0; i < ARRAYLEN(uri_prefixes); i++) {
unsigned int plen = strlen(uri_prefixes[i].prefix);
if (strURI.substr(0, plen) == uri_prefixes[i].prefix) {