wsd: make these a const reference instead of copying for each invocation

This commit is contained in:
Miklos Vajna 2018-07-31 09:18:52 +02:00
parent 33f0e7e893
commit 6f3fd44c03
2 changed files with 4 additions and 4 deletions

View file

@ -431,8 +431,8 @@ void FileServerRequestHandler::handleRequest(const HTTPRequest& request, Poco::M
void FileServerRequestHandler::sendError(int errorCode, const Poco::Net::HTTPRequest& request,
const std::shared_ptr<StreamSocket>& socket,
std::string shortMessage, std::string longMessage,
std::string extraHeader)
const std::string& shortMessage, const std::string& longMessage,
const std::string& extraHeader)
{
Poco::URI requestUri(request.getURI());
std::string path(requestUri.getPath());

View file

@ -43,8 +43,8 @@ public:
private:
static std::map<std::string, std::pair<std::string, std::string>> FileHash;
static void sendError(int errorCode, const Poco::Net::HTTPRequest& request,
const std::shared_ptr<StreamSocket>& socket, std::string shortMessage,
std::string longMessage, std::string extraHeader = "");
const std::shared_ptr<StreamSocket>& socket, const std::string& shortMessage,
const std::string& longMessage, const std::string& extraHeader = "");
};
#endif