Reduces the number of WOPI calls made during a document load. Earlier
effort was made in edfd3266f8
This commit cleans up and uses better approach for the same.
Other than that, access token of each session is now correctly
used when interacting with the storage. Earlier, we used to
use the same access token for each upload to storage which means
that irrespective of who clicked the save button, changes to the
document were only made on behalf of one person (of whom the
access token is used). This is fixed now.
Also includes minor cleanup left and right.
Change-Id: Id32702ff02aea4f63b7cc6afa9f62664807bb57d
Reviewed-on: https://gerrit.libreoffice.org/29931
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This helps debugging and tracing issues as this single log
entry links the three most important pieces together:
the user, how Core references the user's view to a
given document, and how WSD references the same.
Change-Id: I7bf88504b43eed85d40e6f8bc9c3bad713f372da
Reviewed-on: https://gerrit.libreoffice.org/29935
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
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
This saves us from encoding/decoding mess of URIs. Poco::URI is
flexible enough and can give encoded or decoded version whenever
required, so lets avoid storing the URI in std::string where we
have no information about whether its encoded or not.
Change-Id: I4a6979e13b20d9f56fc5a0baa630cb1b35ca33b0
To be used only for truly fatal configuration or resource errors when
the lool service cannot continue functioning at all.
Add also a sysfatal() variant that appends the strerror(errno)
message, like syserror().
And a few other minor fixes. No need to create an std::string object
when a char number is enough, nor need to copy an object when passing it
by reference is enough.
Change-Id: I3d6aba20ffce781532ea77fe079ce64378db6e12
Use a plain pipe, as created by Poco::Process::launch() when you pass
a non-nullptr inPipe pointer to it. Leads to simpler code. No need to
explicitly create a FIFO and open it. In loolforkit, the read fd of
the pipe is now always 0 (stdin).
Creating the pipe ourselves in loolwsd using pipe() and passing the fd
of the read end of the pipe on the loolforkit command-line would not
be much more complex, and was what I first tried. But it did not work,
as Poco::ProcessImpl::launchByForkExecImpl() closes all file
descriptors >= 3. Which is a bit rude, and not documented, but there
you go.
loolwsd is waiting in open() for loolkit to open its end of the pipe,
so if loolforkit exits before it has opened the pipe, loolwsd will
wait forever and not notice that loolkit has exited. Which is not
ideal.
Note that there are other sanity checks done before loolforkit opens
the pipe, and if some of them fail, and loolforkit exits, loolwsd will
be hanging in the open and not notice. Need to carefully look through
that and re-factor as necessary.
Using a named pipe (FIFO) is probably pointless. We should just create
a normal pipe in loolwsd and pass the fd of the reading end on the
command-line to loolforkit.
Calling Log::syserror() just means errno is relevant and its string
should be included in the log line. It is the error() function of the
logger that it calls.
So don't mark log lines produced by calling Log::syserror() with a
separate "SYS" marker, but use the same "ERR" as for Log::error().
For the 'message' parameter of LOOLSession::shutdown(),
ClientSession::shutdownPeer(), and PrisonerSession::shutdownPeer() we
always passed "". It was passed on as the 'statusMessage' parameter to
WebSocet::shutdown() which has "" as default anyway.
- show total number of the rendered tiles of the document, also
the difference between the previous number in the client
- show cached tiles in transparent yellow color (in debug build)
- send ping messages after every invalidation message instead of
keypressing
- fix memory leak: remove unused leaflet rectangle overlays on the
tiles
.uno:TrackedChangeAuthors doesn't give correct colors for
documents other than writer, lets use our old algorithm for color
assignment for these documents.
Change-Id: If865788154a80da2637aad84183a0e947bb4b7e8