mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-09-10 23:59:01 -04:00
Refactoring: moved local variable declarations
This commit is contained in:
parent
659ee6ba71
commit
6c7ab6ff54
@ -889,10 +889,6 @@ Response InternalServer::handle_content(const RequestContext& request)
|
|||||||
printf("** running handle_content\n");
|
printf("** running handle_content\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string content;
|
|
||||||
|
|
||||||
kiwix::Entry entry;
|
|
||||||
|
|
||||||
const std::string bookName = get_book_name(request);
|
const std::string bookName = get_book_name(request);
|
||||||
if (bookName.empty())
|
if (bookName.empty())
|
||||||
return build_homepage(request);
|
return build_homepage(request);
|
||||||
@ -907,6 +903,8 @@ Response InternalServer::handle_content(const RequestContext& request)
|
|||||||
urlStr = urlStr.substr(1);
|
urlStr = urlStr.substr(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
kiwix::Entry entry;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
entry = reader->getEntryFromPath(urlStr);
|
entry = reader->getEntryFromPath(urlStr);
|
||||||
if (entry.isRedirect() || urlStr.empty()) {
|
if (entry.isRedirect() || urlStr.empty()) {
|
||||||
@ -928,6 +926,8 @@ Response InternalServer::handle_content(const RequestContext& request)
|
|||||||
printf("mimeType: %s\n", mimeType.c_str());
|
printf("mimeType: %s\n", mimeType.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string content;
|
||||||
|
|
||||||
if ( is_compressible_mime_type(mimeType) ) {
|
if ( is_compressible_mime_type(mimeType) ) {
|
||||||
zim::Blob raw_content = entry.getBlob();
|
zim::Blob raw_content = entry.getBlob();
|
||||||
content = string(raw_content.data(), raw_content.size());
|
content = string(raw_content.data(), raw_content.size());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user