Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
3a81649a
Kaydet (Commit)
3a81649a
authored
Eki 12, 2010
tarafından
Norbert Thiebaud
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
merge vosremoval-pipe.diff
üst
ef07ecf9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
21 deletions
+18
-21
officeipcthread.cxx
desktop/source/app/officeipcthread.cxx
+15
-18
officeipcthread.hxx
desktop/source/app/officeipcthread.hxx
+3
-3
No files found.
desktop/source/app/officeipcthread.cxx
Dosyayı görüntüle @
3a81649a
...
...
@@ -49,12 +49,10 @@
#include <rtl/bootstrap.hxx>
#include <rtl/strbuf.hxx>
#include <comphelper/processfactory.hxx>
#include
"osl/file.hxx"
#include
<osl/file.hxx>
#include "rtl/process.h"
#include "tools/getprocessworkingdir.hxx"
#include "osl/file.hxx"
using
namespace
vos
;
using
namespace
rtl
;
using
namespace
desktop
;
using
namespace
::
com
::
sun
::
star
::
uno
;
...
...
@@ -506,20 +504,20 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
{
osl
::
Security
&
rSecurity
=
Security
::
get
();
// Try to create pipe
if
(
pThread
->
maPipe
.
create
(
pThread
->
maPipeIdent
.
getStr
(),
OPipe
::
TOption_Create
,
rSecurity
))
if
(
pThread
->
maPipe
.
create
(
pThread
->
maPipeIdent
.
getStr
(),
osl_Pipe_CREATE
,
rSecurity
))
{
// Pipe created
nPipeMode
=
PIPEMODE_CREATED
;
}
else
if
(
pThread
->
maPipe
.
create
(
pThread
->
maPipeIdent
.
getStr
(),
OPipe
::
TOption_Open
,
rSecurity
))
// Creation not successfull, now we try to connect
else
if
(
pThread
->
maPipe
.
create
(
pThread
->
maPipeIdent
.
getStr
(),
osl_Pipe_OPEN
,
rSecurity
))
// Creation not successfull, now we try to connect
{
// Pipe connected to first office
nPipeMode
=
PIPEMODE_CONNECTED
;
}
else
{
OPipe
::
T
PipeError
eReason
=
pThread
->
maPipe
.
getError
();
if
((
eReason
==
OPipe
::
E_ConnectionRefused
)
||
(
eReason
==
OPipe
::
E_invalidError
))
osl
PipeError
eReason
=
pThread
->
maPipe
.
getError
();
if
((
eReason
==
osl_Pipe_E_ConnectionRefused
)
||
(
eReason
==
osl_Pipe_
E_invalidError
))
return
IPC_STATUS_BOOTSTRAP_ERROR
;
// Wait for second office to be ready
...
...
@@ -540,7 +538,7 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
else
{
// Seems another office is running. Pipe arguments to it and self terminate
pThread
->
maStreamPipe
=
pThread
->
maPipe
;
osl
::
StreamPipe
aStreamPipe
(
pThread
->
maPipe
.
getHandle
())
;
sal_Bool
bWaitBeforeClose
=
sal_False
;
ByteString
aArguments
(
RTL_CONSTASCII_STRINGPARAM
(
ARGUMENT_PREFIX
));
...
...
@@ -563,13 +561,13 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
}
}
// finaly, write the string onto the pipe
pThread
->
m
aStreamPipe
.
write
(
aArguments
.
GetBuffer
(),
aArguments
.
Len
()
);
pThread
->
m
aStreamPipe
.
write
(
"
\0
"
,
1
);
aStreamPipe
.
write
(
aArguments
.
GetBuffer
(),
aArguments
.
Len
()
);
aStreamPipe
.
write
(
"
\0
"
,
1
);
// wait for confirmation #95361# #95425#
ByteString
aToken
(
sc_aConfirmationSequence
);
char
*
aReceiveBuffer
=
new
char
[
aToken
.
Len
()
+
1
];
int
n
=
pThread
->
m
aStreamPipe
.
read
(
aReceiveBuffer
,
aToken
.
Len
()
);
int
n
=
aStreamPipe
.
read
(
aReceiveBuffer
,
aToken
.
Len
()
);
aReceiveBuffer
[
n
]
=
'\0'
;
delete
pThread
;
...
...
@@ -598,15 +596,15 @@ void OfficeIPCThread::DisableOfficeIPCThread()
// send thread a termination message
// this is done so the subsequent join will not hang
// because the thread hangs in accept of pipe
OPipe
Pipe
(
pOfficeIPCThread
->
maPipeIdent
,
OPipe
::
TOption_Open
,
Security
::
get
()
);
osl
::
StreamPipe
aPipe
(
pOfficeIPCThread
->
maPipeIdent
,
osl_Pipe_OPEN
,
Security
::
get
()
);
//Pipe.send( TERMINATION_SEQUENCE, TERMINATION_LENGTH );
if
(
Pipe
.
isValid
())
if
(
aPipe
.
is
())
{
Pipe
.
send
(
sc_aTerminationSequence
,
sc_nTSeqLength
+
1
);
// also send 0-byte
a
Pipe
.
send
(
sc_aTerminationSequence
,
sc_nTSeqLength
+
1
);
// also send 0-byte
// close the pipe so that the streampipe on the other
// side produces EOF
Pipe
.
close
();
a
Pipe
.
close
();
}
// release mutex to avoid deadlocks
...
...
@@ -661,11 +659,10 @@ void SAL_CALL OfficeIPCThread::run()
{
do
{
OPipe
::
TPipeError
nError
=
maPipe
.
accept
(
maStreamPipe
);
oslPipeError
nError
=
maPipe
.
accept
(
maStreamPipe
);
if
(
nError
==
OStreamPipe
::
E_None
)
if
(
nError
==
osl_Pipe_
E_None
)
{
// #111143# and others:
...
...
desktop/source/app/officeipcthread.hxx
Dosyayı görüntüle @
3a81649a
...
...
@@ -30,7 +30,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/frame/XTerminateListener.hpp>
#include <
vos
/pipe.hxx>
#include <
osl
/pipe.hxx>
#include <osl/security.hxx>
#include <osl/signal.h>
#include <rtl/ustring.hxx>
...
...
@@ -75,8 +75,8 @@ class OfficeIPCThread : public osl::Thread
static
OfficeIPCThread
*
pGlobalOfficeIPCThread
;
static
::
osl
::
Mutex
*
pOfficeIPCThreadMutex
;
vos
::
OPipe
maPipe
;
vos
::
OStreamPipe
maStreamPipe
;
osl
::
Pipe
maPipe
;
osl
::
StreamPipe
maStreamPipe
;
rtl
::
OUString
maPipeIdent
;
bool
mbDowning
;
bool
mbRequestsEnabled
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment