mirror of https://github.com/kiwix/libkiwix.git
Fix android compilation
Android clang complains about the fact it cannot move the `std::unique_ptr<ContentResponse>` into a `std::unique_ptr<Response>&&` (for the implicit `std::unique_ptr<Response>` constructor). Let's help him a bit.
This commit is contained in:
parent
a3939e9a05
commit
6d5cddca12
|
@ -371,7 +371,7 @@ std::unique_ptr<Response> InternalServer::handle_meta(const RequestContext& requ
|
|||
|
||||
auto response = ContentResponse::build(*this, content, mimeType);
|
||||
response->set_cacheable();
|
||||
return response;
|
||||
return std::move(response);
|
||||
}
|
||||
|
||||
std::unique_ptr<Response> InternalServer::handle_suggest(const RequestContext& request)
|
||||
|
@ -433,7 +433,7 @@ std::unique_ptr<Response> InternalServer::handle_suggest(const RequestContext& r
|
|||
data.set("suggestions", results);
|
||||
|
||||
auto response = ContentResponse::build(*this, RESOURCE::templates::suggestion_json, data, "application/json; charset=utf-8");
|
||||
return response;
|
||||
return std::move(response);
|
||||
}
|
||||
|
||||
std::unique_ptr<Response> InternalServer::handle_skin(const RequestContext& request)
|
||||
|
@ -449,7 +449,7 @@ std::unique_ptr<Response> InternalServer::handle_skin(const RequestContext& requ
|
|||
getResource(resourceName),
|
||||
getMimeTypeForFile(resourceName));
|
||||
response->set_cacheable();
|
||||
return response;
|
||||
return std::move(response);
|
||||
} catch (const ResourceNotFound& e) {
|
||||
return Response::build_404(*this, request, "");
|
||||
}
|
||||
|
@ -523,7 +523,7 @@ std::unique_ptr<Response> InternalServer::handle_search(const RequestContext& re
|
|||
auto response = ContentResponse::build(*this, RESOURCE::templates::no_search_result_html, data, "text/html; charset=utf-8");
|
||||
response->set_taskbar(bookName, reader ? reader->getTitle() : "");
|
||||
response->set_code(MHD_HTTP_NOT_FOUND);
|
||||
return response;
|
||||
return std::move(response);
|
||||
}
|
||||
|
||||
Searcher searcher;
|
||||
|
@ -579,7 +579,7 @@ std::unique_ptr<Response> InternalServer::handle_search(const RequestContext& re
|
|||
response->set_code(MHD_HTTP_NO_CONTENT);
|
||||
}
|
||||
|
||||
return response;
|
||||
return std::move(response);
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << e.what() << std::endl;
|
||||
return Response::build_500(*this, e.what());
|
||||
|
@ -651,7 +651,7 @@ std::unique_ptr<Response> InternalServer::handle_catalog(const RequestContext& r
|
|||
|
||||
if (url == "searchdescription.xml") {
|
||||
auto response = ContentResponse::build(*this, RESOURCE::opensearchdescription_xml, get_default_data(), "application/opensearchdescription+xml");
|
||||
return response;
|
||||
return std::move(response);
|
||||
}
|
||||
|
||||
zim::Uuid uuid;
|
||||
|
@ -710,7 +710,7 @@ std::unique_ptr<Response> InternalServer::handle_catalog(const RequestContext& r
|
|||
*this,
|
||||
opdsDumper.dumpOPDSFeed(bookIdsToDump),
|
||||
"application/atom+xml; profile=opds-catalog; kind=acquisition; charset=utf-8");
|
||||
return response;
|
||||
return std::move(response);
|
||||
}
|
||||
|
||||
namespace
|
||||
|
|
|
@ -71,7 +71,7 @@ std::unique_ptr<Response> Response::build_304(const InternalServer& server, cons
|
|||
auto response = ContentResponse::build(server, "", "");
|
||||
response->set_code(MHD_HTTP_NOT_MODIFIED);
|
||||
response->m_etag = etag;
|
||||
return response;
|
||||
return std::move(response);
|
||||
}
|
||||
|
||||
std::unique_ptr<Response> Response::build_404(const InternalServer& server, const RequestContext& request, const std::string& bookName)
|
||||
|
@ -83,7 +83,7 @@ std::unique_ptr<Response> Response::build_404(const InternalServer& server, cons
|
|||
response->set_code(MHD_HTTP_NOT_FOUND);
|
||||
response->set_taskbar(bookName, "");
|
||||
|
||||
return response;
|
||||
return std::move(response);
|
||||
}
|
||||
|
||||
std::unique_ptr<Response> Response::build_500(const InternalServer& server, const std::string& msg)
|
||||
|
@ -377,7 +377,7 @@ std::unique_ptr<Response> EntryResponse::build(const InternalServer& server, con
|
|||
auto response = ContentResponse::build(server, content, mimetype);
|
||||
response->set_cacheable();
|
||||
response->m_byteRange = byteRange;
|
||||
return response;
|
||||
return std::move(response);
|
||||
}
|
||||
|
||||
if (byteRange.kind() == ByteRange::RESOLVED_UNSATISFIABLE) {
|
||||
|
|
Loading…
Reference in New Issue