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
2fd5a99c
Kaydet (Commit)
2fd5a99c
authored
Tem 11, 2002
tarafından
Carsten Driesner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#96312# Use MD5 as hash function to create pipe name
üst
0dde36c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
5 deletions
+42
-5
officeipcthread.cxx
desktop/source/app/officeipcthread.cxx
+42
-5
No files found.
desktop/source/app/officeipcthread.cxx
Dosyayı görüntüle @
2fd5a99c
...
...
@@ -2,9 +2,9 @@
*
* $RCSfile: officeipcthread.cxx,v $
*
* $Revision: 1.1
7
$
* $Revision: 1.1
8
$
*
* last change: $Author: cd $ $Date: 2002-07-1
0 06:57:45
$
* last change: $Author: cd $ $Date: 2002-07-1
1 10:18:54
$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
...
...
@@ -84,6 +84,12 @@
#ifndef _THREAD_HXX_
#include <osl/thread.hxx>
#endif
#ifndef _RTL_DIGEST_H_
#include <rtl/digest.h>
#endif
#ifndef _RTL_USTRBUF_HXX_
#include <rtl/ustrbuf.hxx>
#endif
using
namespace
vos
;
using
namespace
rtl
;
...
...
@@ -123,6 +129,33 @@ OSecurity OfficeIPCThread::maSecurity;
#endif
::
osl
::
Mutex
*
OfficeIPCThread
::
pOfficeIPCThreadMutex
=
0
;
String
CreateMD5FromString
(
const
OUString
&
aMsg
)
{
rtlDigest
handle
=
rtl_digest_create
(
rtl_Digest_AlgorithmMD5
);
if
(
handle
>
0
)
{
const
sal_uInt8
*
pData
=
(
const
sal_uInt8
*
)
aMsg
.
getStr
();
sal_uInt32
nSize
=
(
aMsg
.
getLength
()
*
sizeof
(
sal_Unicode
));
sal_uInt32
nMD5KeyLen
=
rtl_digest_queryLength
(
handle
);
sal_uInt8
*
pMD5KeyBuffer
=
new
sal_uInt8
[
nSize
];
rtl_digest_init
(
handle
,
pData
,
nSize
);
rtl_digest_get
(
handle
,
pMD5KeyBuffer
,
nMD5KeyLen
);
rtl_digest_destroy
(
handle
);
// Create hex-value string from the MD5 value to keep the string size minimal
OUStringBuffer
aBuffer
((
nMD5KeyLen
*
2
)
+
1
);
for
(
sal_uInt32
i
=
0
;
i
<
nMD5KeyLen
;
i
++
)
aBuffer
.
append
(
(
sal_Int32
)
pMD5KeyBuffer
[
i
],
16
);
delete
[]
pMD5KeyBuffer
;
return
aBuffer
.
makeStringAndClear
();
}
return
String
();
}
class
ProcessEventsClass_Impl
{
public
:
...
...
@@ -450,9 +483,7 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
if
(
pGlobalOfficeIPCThread
)
return
IPC_STATUS_OK
;
::
rtl
::
OUString
aOfficeInstallPath
;
::
rtl
::
OUString
aUserInstallPath
;
::
rtl
::
OUString
aLastIniFile
;
::
rtl
::
OUString
aDummy
;
::
vos
::
OStartupInfo
aInfo
;
...
...
@@ -476,7 +507,13 @@ OfficeIPCThread::Status OfficeIPCThread::EnableOfficeIPCThread()
// First we try to create our pipe if this fails we try to connect. We have to do this
// in a loop because the the other office can crash or shutdown between createPipe
// and connectPipe!!
pThread
->
maPipeIdent
=
pThread
->
maPipeIdent
+
OUString
::
valueOf
(
(
sal_Int32
)
aDummy
.
hashCode
()
);
OUString
aUserInstallPathHashCode
=
CreateMD5FromString
(
aDummy
);
// Check result to create a hash code from the user install path
if
(
aUserInstallPathHashCode
.
getLength
()
==
0
)
return
IPC_STATUS_BOOTSTRAP_ERROR
;
// Something completely broken, we cannot create a valid hash code!
pThread
->
maPipeIdent
=
pThread
->
maPipeIdent
+
aUserInstallPathHashCode
;
PipeMode
nPipeMode
=
PIPEMODE_DONTKNOW
;
do
...
...
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