cid#344351 COPY_INSTEAD_OF_MOVE

and

cid#336280 COPY_INSTEAD_OF_MOVE
cid#318848 COPY_INSTEAD_OF_MOVE
cid#318964 COPY_INSTEAD_OF_MOVE
cid#344354 COPY_INSTEAD_OF_MOVE

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I60a904be4b5edf61cfd5b2efab81e5c1a089b661
pull/8190/head
Caolán McNamara 2024-02-10 20:18:01 +00:00 committed by Miklos Vajna
parent 794d24b046
commit 71a427c465
4 changed files with 5 additions and 10 deletions

View File

@ -713,10 +713,7 @@ void SocketDisposition::execute()
assert (isTransfer());
// Ensure the thread is running before adding callback.
_toPoll->startThread();
auto pollCopy = _toPoll;
auto socket = _socket;
auto socketMoveFn = std::move(_socketMove);
_toPoll->addCallback([pollCopy, socket, socketMoveFn]()
_toPoll->addCallback([pollCopy = _toPoll, socket = _socket, socketMoveFn = std::move(_socketMove)]()
{
pollCopy->insertNewSocket(socket);
socketMoveFn(socket);

View File

@ -5295,8 +5295,7 @@ private:
if (docBroker)
{
// need to move into the DocumentBroker context before doing session lookup / creation etc.
std::string id = _id;
docBroker->setupTransfer(disposition, [docBroker, id, uriPublic,
docBroker->setupTransfer(disposition, [docBroker, id = _id, uriPublic,
isReadOnly, requestDetails]
(const std::shared_ptr<Socket> &moveSocket)
{

View File

@ -3414,8 +3414,7 @@ void DocumentBroker::handleMediaRequest(std::string range,
auto session = std::make_shared<http::server::Session>();
session->asyncUpload(path, "video/mp4", std::move(range));
auto handler = std::static_pointer_cast<ProtocolHandlerInterface>(session);
streamSocket->setHandler(handler);
streamSocket->setHandler(std::static_pointer_cast<ProtocolHandlerInterface>(session));
}
}
}

View File

@ -260,7 +260,7 @@ void RequestVettingStation::checkFileInfo(SocketPoll& poll, const std::string& u
createDocBroker(docKey, url, uriPublic, isReadOnly, std::move(wopiInfo));
};
_httpSession->setFinishedHandler(finishedCallback);
_httpSession->setFinishedHandler(std::move(finishedCallback));
// Run the CheckFileInfo request on the WebServer Poll.
_httpSession->asyncRequest(httpRequest, poll);
@ -301,7 +301,7 @@ void RequestVettingStation::createDocBroker(const std::string& docKey, const std
const auto ws = _ws;
docBroker->setupTransfer(
_socket,
[clientSession, uriPublic, wopiInfo, ws,
[clientSession, uriPublic, wopiInfo=std::move(wopiInfo), ws,
docBroker](const std::shared_ptr<Socket>& moveSocket) mutable
{
try