Skip to content

Commit

Permalink
Fix redis erroring on non found blocks
Browse files Browse the repository at this point in the history
Thanks to @netinetwalker for spotting the error, proposing a fix, and testing it.

Error due to @est31's merging changes to PR #3202 to add more error reporting for invalid reply types, commit:

524a765 "redis: throw error if block request failed"

Now we branch out on the valid reply type "not found".
  • Loading branch information
est31 committed Sep 26, 2015
1 parent 88a4412 commit 4338f10
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/database-redis.cpp
Expand Up @@ -126,6 +126,11 @@ std::string Database_Redis::loadBlock(const v3s16 &pos)
throw FileNotGoodException(std::string(
"Redis command 'HGET %s %s' errored: ") + errstr);
}
case REDIS_REPLY_NIL: {
// block not found in database
freeReplyObject(reply);
return "";
}
}
errorstream << "loadBlock: loading block " << PP(pos)
<< " returned invalid reply type " << reply->type
Expand Down

0 comments on commit 4338f10

Please sign in to comment.