Commit 0a483e96 authored by Oleg.Korshul's avatar Oleg.Korshul Committed by Alexander Trofimov

убрал CriticalSection в ZLibUtils (TODO: убрать там выставление текущей директории)

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@63812 954022d7-b5bf-4e40-9824-e11837661b57
parent 6a4f4fa9
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
namespace ZLibZipUtils namespace ZLibZipUtils
{ {
AVSOfficeCriticalSection criticalSection;
static zipFile zipOpenHelp(const wchar_t* filename) static zipFile zipOpenHelp(const wchar_t* filename)
{ {
#if defined(_WIN32) || defined (_WIN64) #if defined(_WIN32) || defined (_WIN64)
...@@ -450,8 +449,6 @@ namespace ZLibZipUtils ...@@ -450,8 +449,6 @@ namespace ZLibZipUtils
/*========================================================================================================*/ /*========================================================================================================*/
int ZipDir( const WCHAR* dir, const WCHAR* outputFile, const OnProgressCallback* progress, int compressionLevel ) int ZipDir( const WCHAR* dir, const WCHAR* outputFile, const OnProgressCallback* progress, int compressionLevel )
{ {
criticalSection.Enter();
int err = -1; int err = -1;
if ( ( dir != NULL ) && ( outputFile != NULL ) ) if ( ( dir != NULL ) && ( outputFile != NULL ) )
...@@ -563,8 +560,6 @@ namespace ZLibZipUtils ...@@ -563,8 +560,6 @@ namespace ZLibZipUtils
} }
} }
criticalSection.Leave();
return err; return err;
} }
...@@ -572,8 +567,6 @@ namespace ZLibZipUtils ...@@ -572,8 +567,6 @@ namespace ZLibZipUtils
int ZipFile( const WCHAR* inputFile, const WCHAR* outputFile, int compressionLevel ) int ZipFile( const WCHAR* inputFile, const WCHAR* outputFile, int compressionLevel )
{ {
criticalSection.Enter();
int err = -1; int err = -1;
if ( ( inputFile != NULL ) && ( outputFile != NULL ) ) if ( ( inputFile != NULL ) && ( outputFile != NULL ) )
...@@ -635,8 +628,6 @@ namespace ZLibZipUtils ...@@ -635,8 +628,6 @@ namespace ZLibZipUtils
} }
} }
criticalSection.Leave();
return false; return false;
} }
...@@ -644,8 +635,6 @@ namespace ZLibZipUtils ...@@ -644,8 +635,6 @@ namespace ZLibZipUtils
bool ClearDirectory( const WCHAR* dir, bool delDir ) bool ClearDirectory( const WCHAR* dir, bool delDir )
{ {
criticalSection.Enter();
bool result = false; bool result = false;
if ( dir != NULL ) if ( dir != NULL )
...@@ -676,8 +665,6 @@ namespace ZLibZipUtils ...@@ -676,8 +665,6 @@ namespace ZLibZipUtils
result = false; result = false;
} }
criticalSection.Leave();
return result; return result;
} }
...@@ -685,8 +672,6 @@ namespace ZLibZipUtils ...@@ -685,8 +672,6 @@ namespace ZLibZipUtils
int UnzipToDir( const WCHAR* zipFile, const WCHAR* unzipDir, const OnProgressCallback* progress, const WCHAR* password, bool opt_extract_without_path, bool clearOutputDirectory ) int UnzipToDir( const WCHAR* zipFile, const WCHAR* unzipDir, const OnProgressCallback* progress, const WCHAR* password, bool opt_extract_without_path, bool clearOutputDirectory )
{ {
criticalSection.Enter();
unzFile uf = NULL; unzFile uf = NULL;
int err = -1; int err = -1;
...@@ -748,8 +733,6 @@ namespace ZLibZipUtils ...@@ -748,8 +733,6 @@ namespace ZLibZipUtils
} }
} }
criticalSection.Leave();
return err; return err;
} }
...@@ -757,14 +740,10 @@ namespace ZLibZipUtils ...@@ -757,14 +740,10 @@ namespace ZLibZipUtils
int UncompressBytes( BYTE* destBuf, ULONG* destSize, const BYTE* sourceBuf, ULONG sourceSize ) int UncompressBytes( BYTE* destBuf, ULONG* destSize, const BYTE* sourceBuf, ULONG sourceSize )
{ {
criticalSection.Enter();
int err = -1; int err = -1;
err = uncompress( destBuf, destSize, sourceBuf, sourceSize ); err = uncompress( destBuf, destSize, sourceBuf, sourceSize );
criticalSection.Leave();
return err; return err;
} }
...@@ -772,14 +751,10 @@ namespace ZLibZipUtils ...@@ -772,14 +751,10 @@ namespace ZLibZipUtils
int CompressBytes( BYTE* destBuf, ULONG* destSize, const BYTE* sourceBuf, ULONG sourceSize, SHORT level ) int CompressBytes( BYTE* destBuf, ULONG* destSize, const BYTE* sourceBuf, ULONG sourceSize, SHORT level )
{ {
criticalSection.Enter();
int err = -1; int err = -1;
err = compress2( destBuf, destSize, sourceBuf, sourceSize, level ); err = compress2( destBuf, destSize, sourceBuf, sourceSize, level );
criticalSection.Leave();
return err; return err;
} }
...@@ -787,8 +762,6 @@ namespace ZLibZipUtils ...@@ -787,8 +762,6 @@ namespace ZLibZipUtils
bool IsArchive(const WCHAR* filename) bool IsArchive(const WCHAR* filename)
{ {
criticalSection.Enter();
unzFile uf = NULL; unzFile uf = NULL;
bool isZIP = false; bool isZIP = false;
...@@ -801,8 +774,6 @@ namespace ZLibZipUtils ...@@ -801,8 +774,6 @@ namespace ZLibZipUtils
unzClose( uf ); unzClose( uf );
} }
criticalSection.Leave();
return isZIP; return isZIP;
} }
...@@ -810,8 +781,6 @@ namespace ZLibZipUtils ...@@ -810,8 +781,6 @@ namespace ZLibZipUtils
bool IsFileExistInArchive(const WCHAR* zipFile, const WCHAR* filePathInZip) bool IsFileExistInArchive(const WCHAR* zipFile, const WCHAR* filePathInZip)
{ {
criticalSection.Enter();
unzFile uf = NULL; unzFile uf = NULL;
bool isIn = false; bool isIn = false;
...@@ -823,7 +792,6 @@ namespace ZLibZipUtils ...@@ -823,7 +792,6 @@ namespace ZLibZipUtils
unzClose( uf ); unzClose( uf );
} }
criticalSection.Leave();
return isIn; return isIn;
} }
...@@ -831,8 +799,6 @@ namespace ZLibZipUtils ...@@ -831,8 +799,6 @@ namespace ZLibZipUtils
bool LoadFileFromArchive(const WCHAR* zipFile, const WCHAR* filePathInZip, BYTE** fileInBytes, ULONG& nFileSize) bool LoadFileFromArchive(const WCHAR* zipFile, const WCHAR* filePathInZip, BYTE** fileInBytes, ULONG& nFileSize)
{ {
criticalSection.Enter();
unzFile uf = NULL; unzFile uf = NULL;
bool isIn = false; bool isIn = false;
...@@ -845,7 +811,6 @@ namespace ZLibZipUtils ...@@ -845,7 +811,6 @@ namespace ZLibZipUtils
unzClose( uf ); unzClose( uf );
} }
criticalSection.Leave();
return isIn; return isIn;
} }
...@@ -853,8 +818,6 @@ namespace ZLibZipUtils ...@@ -853,8 +818,6 @@ namespace ZLibZipUtils
bool ExtractFiles(const wchar_t* zip_file_path, const ExtractedFileCallback& callback, void* pParam) bool ExtractFiles(const wchar_t* zip_file_path, const ExtractedFileCallback& callback, void* pParam)
{ {
CSLocker locker(criticalSection);
unzFile unzip_file_handle = unzOpenHelp(zip_file_path); unzFile unzip_file_handle = unzOpenHelp(zip_file_path);
if ( unzip_file_handle != NULL ) if ( unzip_file_handle != NULL )
{ {
...@@ -882,8 +845,6 @@ namespace ZLibZipUtils ...@@ -882,8 +845,6 @@ namespace ZLibZipUtils
bool CompressFiles(const wchar_t* zip_file_path, const RequestFileCallback& callback, void* pParam, int compression_level) bool CompressFiles(const wchar_t* zip_file_path, const RequestFileCallback& callback, void* pParam, int compression_level)
{ {
CSLocker locker(criticalSection);
zipFile zip_file_handle = zipOpenHelp(zip_file_path); zipFile zip_file_handle = zipOpenHelp(zip_file_path);
if(NULL != zip_file_handle) if(NULL != zip_file_handle)
......
...@@ -74,6 +74,22 @@ SOURCES += \ ...@@ -74,6 +74,22 @@ SOURCES += \
../../ZLIB/zlib-1.2.3/contrib/minizip/unzip.c \ ../../ZLIB/zlib-1.2.3/contrib/minizip/unzip.c \
../../ZLIB/zlib-1.2.3/contrib/minizip/zip.c ../../ZLIB/zlib-1.2.3/contrib/minizip/zip.c
#SOURCES += \
# ../../ZLIB/zlib-1.2.3/adler32.c \
# ../../ZLIB/zlib-1.2.3/compress.c \
# ../../ZLIB/zlib-1.2.3/crc32.c \
# ../../ZLIB/zlib-1.2.3/deflate.c \
# ../../ZLIB/zlib-1.2.3/example.c \
# ../../ZLIB/zlib-1.2.3/gzio.c \
# ../../ZLIB/zlib-1.2.3/infback.c \
# ../../ZLIB/zlib-1.2.3/inffast.c \
# ../../ZLIB/zlib-1.2.3/inflate.c \
# ../../ZLIB/zlib-1.2.3/inftrees.c \
# ../../ZLIB/zlib-1.2.3/minigzip.c \
# ../../ZLIB/zlib-1.2.3/trees.c \
# ../../ZLIB/zlib-1.2.3/uncompr.c \
# ../../ZLIB/zlib-1.2.3/zutil.c
HEADERS += \ HEADERS += \
../OfficeUtilsCommon.h \ ../OfficeUtilsCommon.h \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment