Skip to content

Commit

Permalink
Test commit, will be rewritten post testing
Browse files Browse the repository at this point in the history
  • Loading branch information
maneeshpm committed Jan 8, 2022
1 parent df82c3d commit cbd97e3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/server/internalServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ unsigned parseIllustration(const std::string& s)
unsigned int getCacheLength(const char* name, unsigned int defaultVal) {
auto envString = std::getenv(name);
try {
std::cout << "Reading env" << extractFromString<unsigned int>(envString) << std::endl;
return extractFromString<unsigned int>(envString);
} catch (...) {}

Expand Down Expand Up @@ -459,9 +460,10 @@ std::unique_ptr<Response> InternalServer::handle_suggest(const RequestContext& r

std::string bookName;
std::shared_ptr<zim::Archive> archive;
std::string bookId;
try {
bookName = request.get_argument("content");
const std::string bookId = mp_nameMapper->getIdForName(bookName);
bookId = mp_nameMapper->getIdForName(bookName);
archive = mp_library->getArchiveById(bookId);
} catch (const std::out_of_range&) {
// error handled by the archive == nullptr check below
Expand Down Expand Up @@ -569,9 +571,10 @@ std::unique_ptr<Response> InternalServer::handle_search(const RequestContext& re

std::string bookName;
std::shared_ptr<zim::Archive> archive;
std::string bookId;
try {
bookName = request.get_argument("content");
const std::string bookId = mp_nameMapper->getIdForName(bookName);
bookId = mp_nameMapper->getIdForName(bookName);
archive = mp_library->getArchiveById(bookId);
} catch (const std::out_of_range&) {}

Expand Down

0 comments on commit cbd97e3

Please sign in to comment.