db: add compile-time option to disable database

This commit is contained in:
Max Kellermann
2014-01-30 20:29:48 +01:00
parent 34b309b99a
commit 4465e2c46b
25 changed files with 297 additions and 57 deletions

View File

@@ -127,12 +127,17 @@ handle_read_comments(Client &client, gcc_unused int argc, char *argv[])
} else if (uri_has_scheme(uri)) {
return read_stream_comments(client, uri);
} else if (*uri != '/') {
#ifdef ENABLE_DATABASE
path_fs = map_uri_fs(uri);
if (path_fs.IsNull()) {
command_error(client, ACK_ERROR_NO_EXIST,
"No such file");
return CommandResult::ERROR;
}
#else
command_error(client, ACK_ERROR_NO_EXIST, "No database");
return CommandResult::ERROR;
#endif
} else {
command_error(client, ACK_ERROR_NO_EXIST, "No such file");
return CommandResult::ERROR;