Use g_idle_add() to make the webkit_web_view_run_javascript() call run
on the GTK+ thread. Correspondingly, need to use a separate
short-lived thread to do the fakeSocketWrite() calls from
handle_lool_message(), so that the GTK+ main loop is ready to run the
added lambda. Or something like that.
Now it gets a bit further, doesn't crash, but just sudddenly exits
before showing the document even.
Add plumbing to send messages from the Online code to the JavaScript
code, and vice versa. Similar to what is done for iOS.
Sadly, it crashes. Multi-thread issues. Not surprisingly, it crashes
when I call webkit_web_view_run_javascript() in another thread than
the one where the GTK+ and other Webkit calls were done. I need to
come up with some clever way to do everything from the same thread.
(On iOS, I use dispatch_async(dispatch_get_main_queue(),...) to
schedule a block (i.e., a lambda expression) to be run in the main
thread.)
Doesn't matter in "real" Online where the kit process will die shortly
after that ayway, but matters a lot in the mobile app, where there is
just one process all the time that handles document after document.
Now I can successfully load another document after closing the first
in the iOS app.
The global TerminationFlag is an abomination that has caused lots of
trouble when developing the mobile app. The less we use it the better.
Here, it gets set elsewhere already when needed; just having no
sessions is not reason enough to set it.
The wakeup() call in SocketPoll::stop() doesn't always (or ever?)
actually cause the wakeup code to be invoked and callbacks called
right after, and we don't want to risk the leftover callbacks being
invoked when the same SocketPoll object is started again. (This did
actually happen.)
In a normal Online, this is not a problem, as SocketPolls aren't
reused. One document per kit process, a separate kit process for each
document. Not so in a mobile app, there we have just one process that
handles document after document as the user closes one, opens another
(or the same anew), etc.
Anonymizing is useless with trace anyway, since no
trace log entry anonymizes, it's more useful to
disable anonymization to help troubleshoot (which is
the reason for enabling tracing in the first place).
Change-Id: I437207e7a798c2288a5d5eb33446cb16491bfbf6
Reviewed-on: https://gerrit.libreoffice.org/59534
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
(cherry picked from commit a2809fd27277fd01d0dafdc0c4f0435fdf85db36)
Also move anonymization initialization after logging is initialized.
Change-Id: I5c3753f0b11ae9c3376235e22af204eb3a57f5c8
(cherry picked from commit 02076bdb9128ffe7c26d8bcf420b659ec1d68280)
Also support anonymization of downloadas documents
and renaming of documents.
Reviewed-on: https://gerrit.libreoffice.org/57541
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 78248a542c9ca31bf9ad4cad9b55d78690384395)
Change-Id: I81a80e6290217659987d73f625e5f0fb81cb7ef2
This is important for when we abort with some explanation.
Often said explanation doesn't show up anywhere to be useful.
Also, issue fatal logs for abnormal exist and use SFL to log errno.
Reviewed-on: https://gerrit.libreoffice.org/57540
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit ad7964393eadb68873b820e0a620fb40f1e1b06a)
Change-Id: Ic67064ef40ef6e93d26e5847ecd32bdd49c3cc8b
Useful for troubleshooting and other non-prod setups.
To enable, add a subnode under logging/anonymize in
loolwsd.xml called allow_logging_pii with a boolean
value of true:
<logging>
<anonymize>
<allow_logging_pii>true</allow_logging_pii>
</anonymize>
</logging>
Reviewed-on: https://gerrit.libreoffice.org/56568
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 829b4722817b89445701a378ffa6b597b906bb7d)
Change-Id: If74acaac0ea442ee5a7860453182180663a5108b
And inform the user of the anonymization level.
Reviewed-on: https://gerrit.libreoffice.org/56567
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
(cherry picked from commit 13f3b7848f9cd77dc7a1e82f0fba656dbd503b4c)
Change-Id: I95cf832d5c4103744207214ffbf4e85d177ff190
This prevents disabling from loolwsd.xml when
the flags to anonymize are baked in at compile time.
Change-Id: If38ad3815bc9f18ed51b6626fc8c03528e7b8327
Reviewed-on: https://gerrit.libreoffice.org/56089
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
(cherry picked from commit 8844d238f1c7a0bd71f6ddd3b59f4ea18bf3bdbb)