|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
From 5b29409ae1ec8c75296a257dfc02b6acb296a527 Mon Sep 17 00:00:00 2001
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
From: Stephan Bergmann <sbergman@redhat.com>
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
Date: Thu, 13 Dec 2012 15:41:10 +0100
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
Subject: [PATCH 2/2] Related fdo#33484: Terminate OfficeIPCThread by closing
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
the accepting pipe
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
... (and setting mbDowning to indicate an error returned from accept() is due to
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
termination) instead of setting up an extra pipe connection to send an
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
"InternalIPC::TerminateThread" message (which allegedly caused deadlocks, see
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
<https://gerrit.libreoffice.org/#/c/1311/> "Change Idf933915: office ipc: use
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
timeout pipe feature when connecting to self").
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
Change-Id: Id302ca13112fc409685e7665b38f1030704a0ccf
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
(cherry picked from commit 4ce2602befd59e69264d8e4ced8730b40c2b947c)
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
Conflicts:
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
desktop/source/app/officeipcthread.cxx
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
desktop/source/app/officeipcthread.hxx
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
(cherry picked from commit 6527b8a135c20e223a6fcf7c49835205a99ff02a)
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
---
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
desktop/source/app/officeipcthread.cxx | 54 +++++++++++++++-------------------
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
desktop/source/app/officeipcthread.hxx | 1 -
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
2 files changed, 23 insertions(+), 32 deletions(-)
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
diff --git a/desktop/source/app/officeipcthread.cxx b/desktop/source/app/officeipcthread.cxx
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
index 452a3b5..1d37ee0 100644
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
--- a/desktop/source/app/officeipcthread.cxx
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+++ b/desktop/source/app/officeipcthread.cxx
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
@@ -60,8 +60,6 @@ using ::rtl::OString;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
using ::rtl::OUString;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
using ::rtl::OUStringBuffer;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
-const char *OfficeIPCThread::sc_aTerminationSequence = "InternalIPC::TerminateThread";
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
-const int OfficeIPCThread::sc_nTSeqLength = 28;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
const char *OfficeIPCThread::sc_aShowSequence = "-tofront";
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
const int OfficeIPCThread::sc_nShSeqLength = 5;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
const char *OfficeIPCThread::sc_aConfirmationSequence = "InternalIPC::ProcessingDone";
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
@@ -436,8 +434,6 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
rtl::Reference< OfficeIPCThread > pThread(new OfficeIPCThread);
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- pThread->maPipeIdent = OUString( "SingleOfficeIPC_" );
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
-
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
// The name of the named pipe is created with the hashcode of the user installation directory (without /user). We have to retrieve
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
// this information from a unotools implementation.
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
::utl::Bootstrap::PathStatus aLocateResult = ::utl::Bootstrap::locateUserInstallation( aUserInstallPath );
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
@@ -494,19 +490,19 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
if ( aUserInstallPathHashCode.isEmpty() )
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
return IPC_STATUS_BOOTSTRAP_ERROR; // Something completely broken, we cannot create a valid hash code!
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- pThread->maPipeIdent = pThread->maPipeIdent + aUserInstallPathHashCode;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ OUString aPipeIdent( "SingleOfficeIPC_" + aUserInstallPathHashCode );
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
PipeMode nPipeMode = PIPEMODE_DONTKNOW;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
do
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
{
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
osl::Security &rSecurity = Security::get();
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
// Try to create pipe
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- if ( pThread->maPipe.create( pThread->maPipeIdent.getStr(), osl_Pipe_CREATE, rSecurity ))
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ if ( pThread->maPipe.create( aPipeIdent.getStr(), osl_Pipe_CREATE, rSecurity ))
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
{
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
// Pipe created
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
nPipeMode = PIPEMODE_CREATED;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
}
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- else if( pThread->maPipe.create( pThread->maPipeIdent.getStr(), osl_Pipe_OPEN, rSecurity )) // Creation not successfull, now we try to connect
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ else if( pThread->maPipe.create( aPipeIdent.getStr(), osl_Pipe_OPEN, rSecurity )) // Creation not successfull, now we try to connect
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
{
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
osl::StreamPipe aStreamPipe(pThread->maPipe.getHandle());
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
char pReceiveBuffer[sc_nCSASeqLength + 1];
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
@@ -610,18 +606,8 @@ void OfficeIPCThread::DisableOfficeIPCThread()
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
pGlobalOfficeIPCThread);
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
pGlobalOfficeIPCThread.clear();
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- // send thread a termination message
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- // this is done so the subsequent join will not hang
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- // because the thread hangs in accept of pipe
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- osl::StreamPipe aPipe ( pOfficeIPCThread->maPipeIdent, osl_Pipe_OPEN, Security::get() );
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- if (aPipe.is())
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- {
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- aPipe.send( sc_aTerminationSequence, sc_nTSeqLength+1 ); // also send 0-byte
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
-
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- // close the pipe so that the streampipe on the other
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- // side produces EOF
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- aPipe.close();
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- }
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ pOfficeIPCThread->mbDowning = true;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ pOfficeIPCThread->maPipe.close();
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
// release mutex to avoid deadlocks
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
aMutex.clear();
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
@@ -686,22 +672,23 @@ void OfficeIPCThread::execute()
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
// down during wait
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
osl::ClearableMutexGuard aGuard( GetMutex() );
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- if (!mbDowning)
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ if ( mbDowning )
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
{
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- // notify client we're ready to process its args
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- int nBytes = 0;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- int nResult = 0;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- while (
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- (nResult = maStreamPipe.send(sc_aSendArgumentsSequence+nBytes, sc_nCSASeqLength-nBytes))>0 &&
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- ((nBytes += nResult) < sc_nCSASeqLength) ) ;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ break;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
}
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ // notify client we're ready to process its args
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ int nBytes = 0;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ int nResult;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ while (
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ (nResult = maStreamPipe.send(sc_aSendArgumentsSequence+nBytes, sc_nCSASeqLength-nBytes))>0 &&
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ ((nBytes += nResult) < sc_nCSASeqLength) ) ;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
maStreamPipe.write("\0", 1);
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
// test byte by byte
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
const int nBufSz = 2048;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
char pBuf[nBufSz];
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- int nBytes = 0;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- int nResult = 0;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ nBytes = 0;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
rtl::OStringBuffer aBuf;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
// read into pBuf until '\0' is read or read-error
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
while ((nResult=maStreamPipe.recv( pBuf+nBytes, nBufSz-nBytes))>0) {
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
@@ -719,9 +706,6 @@ void OfficeIPCThread::execute()
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
if (aArguments.isEmpty())
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
continue;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- // is this a termination message ? if so, terminate
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- if (aArguments.equalsL(sc_aTerminationSequence, sc_nTSeqLength) || mbDowning)
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- return;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
std::auto_ptr< CommandLineArgs > aCmdLineArgs;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
try
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
{
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
@@ -938,6 +922,14 @@ void OfficeIPCThread::execute()
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
}
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
else
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
{
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ {
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ osl::MutexGuard aGuard( GetMutex() );
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ if ( mbDowning )
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ {
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ break;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+ }
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
fprintf( stderr, "Error on accept: %d\n", (int)nError );
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
#endif
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
diff --git a/desktop/source/app/officeipcthread.hxx b/desktop/source/app/officeipcthread.hxx
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
index ba40b57..09e56da 100644
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
--- a/desktop/source/app/officeipcthread.hxx
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
+++ b/desktop/source/app/officeipcthread.hxx
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
@@ -82,7 +82,6 @@ class OfficeIPCThread : public salhelper::Thread
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
osl::Pipe maPipe;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
osl::StreamPipe maStreamPipe;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
- rtl::OUString maPipeIdent;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
bool mbDowning;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
bool mbRequestsEnabled;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
int mnPendingRequests;
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
--
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
1.7.11.7
|
|
![](https://seccdn.libravatar.org/avatar/c89f0607eb9ec65833c823fb33bcb40a1bffc52efb8d20082f4a6e9761f696c8?s=16&d=retro) |
9d1e678 |
|