edfd3266f8
This reduces the number of fileinfo calls made to storage. These calls can be expensive in storage such as WOPI where loolwsd needs to interact with another server to get the file information. Use the same storage object once created so that fileinfo can be cached and returned quickly for subsequent such calls. 3 GetFileInfo WOPI calls are now merged into 1. Change-Id: I56c3d23d3d6d7dc3a4b42433f51304dac28a12e8
40 lines
1.3 KiB
C++
40 lines
1.3 KiB
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
|
|
/*
|
|
* This file is part of the LibreOffice project.
|
|
*
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
*/
|
|
|
|
#include "Unit.hpp"
|
|
#include "UnitHTTP.hpp"
|
|
|
|
class UnitStorage : public UnitWSD
|
|
{
|
|
public:
|
|
virtual bool createStorage(const Poco::URI& /* uri */,
|
|
const std::string& /* jailRoot */,
|
|
const std::string& /* jailPath */,
|
|
std::unique_ptr<StorageBase> & /* rStorage */)
|
|
{
|
|
// leave rStorage empty - fail to return anything
|
|
return true;
|
|
}
|
|
virtual void invokeTest()
|
|
{
|
|
// FIXME: push through to the right place to exercise this.
|
|
exitTest(TestResult::TEST_OK);
|
|
UnitHTTPServerResponse response;
|
|
UnitHTTPServerRequest request(response, std::string(CHILD_URI));
|
|
UnitWSD::testHandleRequest(TestRequest::TEST_REQ_PRISONER,
|
|
request, response);
|
|
}
|
|
};
|
|
|
|
UnitBase *unit_create_wsd(void)
|
|
{
|
|
return new UnitStorage();
|
|
}
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|