103 lines
4.2 KiB
Diff
103 lines
4.2 KiB
Diff
diff -uNr zarafa-7.1.10.orig/ECtools/zarafa-search/ECIndexImporterAttachments.cpp zarafa-7.1.10/ECtools/zarafa-search/ECIndexImporterAttachments.cpp
|
|
--- zarafa-7.1.10.orig/ECtools/zarafa-search/ECIndexImporterAttachments.cpp 2014-06-28 01:27:40.776120070 +0200
|
|
+++ zarafa-7.1.10/ECtools/zarafa-search/ECIndexImporterAttachments.cpp 2014-06-28 01:27:54.903119472 +0200
|
|
@@ -47,6 +47,10 @@
|
|
*
|
|
*/
|
|
|
|
+#include <algorithm>
|
|
+#include <set>
|
|
+#include <string>
|
|
+
|
|
#include <platform.h>
|
|
|
|
#include <mapi.h>
|
|
@@ -248,7 +252,7 @@
|
|
ULONG ulWriteData;
|
|
fd_set rset, wset;
|
|
int res;
|
|
- int fd = max(ulFpWrite, ulFpRead);
|
|
+ int fd = std::max(ulFpWrite, ulFpRead);
|
|
struct timeval timeout;
|
|
|
|
|
|
@@ -269,7 +273,7 @@
|
|
FD_ZERO(&wset);
|
|
if (ulTotalWriteData) {
|
|
FD_SET(ulFpWrite, &wset);
|
|
- fd = max(ulFpWrite, ulFpRead);
|
|
+ fd = std::max(ulFpWrite, ulFpRead);
|
|
} else {
|
|
fd = ulFpRead;
|
|
}
|
|
@@ -439,10 +443,10 @@
|
|
command.assign(m_strCommand + " ");
|
|
|
|
if (!strMimeTag.empty() && strMimeTag.compare(_T("application/octet-stream")) != 0) {
|
|
- string tmp = trim(convert_to<string>(strMimeTag), "\r\n ");
|
|
+ std::string tmp = trim(convert_to<std::string>(strMimeTag), "\r\n ");
|
|
size_t pos = tmp.find_first_of('/');
|
|
if (pos != std::string::npos) {
|
|
- set<string, stricmp_comparison>::iterator i = m_lpThreadData->m_setMimeFilter.find(string(tmp,0,pos));
|
|
+ std::set<std::string, stricmp_comparison>::iterator i = m_lpThreadData->m_setMimeFilter.find(std::string(tmp,0,pos));
|
|
if (i != m_lpThreadData->m_setMimeFilter.end()) {
|
|
m_lpThreadData->lpLogger->Log(EC_LOGLEVEL_DEBUG, "Skipping filtered attachment mimetype: %s for %ls", tmp.c_str(), strFilename.c_str());
|
|
hr = MAPI_E_INVALID_OBJECT;
|
|
@@ -454,8 +458,8 @@
|
|
command.append("'");
|
|
} else if (!strExtension.empty()) {
|
|
// this string mostly does not exist
|
|
- string tmp = trim(convert_to<string>(strExtension), "\r\n ");
|
|
- set<string, stricmp_comparison>::iterator i = m_lpThreadData->m_setExtFilter.find(string(tmp,1)); // skip dot in extension find
|
|
+ std::string tmp = trim(convert_to<std::string>(strExtension), "\r\n ");
|
|
+ std::set<std::string, stricmp_comparison>::iterator i = m_lpThreadData->m_setExtFilter.find(std::string(tmp,1)); // skip dot in extension find
|
|
if (i != m_lpThreadData->m_setExtFilter.end()) {
|
|
m_lpThreadData->lpLogger->Log(EC_LOGLEVEL_DEBUG, "Skipping filtered attachment extension: %s for %ls", tmp.c_str(), strFilename.c_str());
|
|
hr = MAPI_E_INVALID_OBJECT;
|
|
@@ -465,14 +469,14 @@
|
|
command.append(forcealnum(tmp, "."));
|
|
command.append("'");
|
|
} else if (!strFilename.empty()) {
|
|
- std::string tmp = trim(convert_to<string>(strFilename), "\r\n ");
|
|
+ std::string tmp = trim(convert_to<std::string>(strFilename), "\r\n ");
|
|
size_t pos = tmp.find_last_of('.');
|
|
if (pos == std::string::npos)
|
|
goto exit;
|
|
|
|
|
|
// skip dot in find
|
|
- set<string, stricmp_comparison>::iterator i = m_lpThreadData->m_setExtFilter.find(string(tmp, pos+1));
|
|
+ std::set<std::string, stricmp_comparison>::iterator i = m_lpThreadData->m_setExtFilter.find(std::string(tmp, pos+1));
|
|
if (i != m_lpThreadData->m_setExtFilter.end()) {
|
|
m_lpThreadData->lpLogger->Log(EC_LOGLEVEL_DEBUG, "Skipping filtered attachment extension: %ls", strFilename.c_str());
|
|
hr = MAPI_E_INVALID_OBJECT;
|
|
@@ -480,7 +484,7 @@
|
|
}
|
|
|
|
command.append("ext '");
|
|
- command.append(forcealnum(string(tmp, pos), "."));
|
|
+ command.append(forcealnum(std::string(tmp, pos), "."));
|
|
command.append("'");
|
|
} else {
|
|
m_lpThreadData->lpLogger->Log(EC_LOGLEVEL_DEBUG, "Invalid attachment, no mimetag, extension or filename");
|
|
@@ -601,7 +605,7 @@
|
|
if (ulAttachSize) {
|
|
/* Copy attachment data into stream */
|
|
while (TRUE) {
|
|
- ULONG ulRead = min(m_ulCache, ulAttachSize);
|
|
+ ULONG ulRead = std::min(m_ulCache, ulAttachSize);
|
|
ULONG ulCopy = ulRead;
|
|
ULONG ulWritten = 0;
|
|
|
|
diff -uNr zarafa-7.1.10.orig/ECtools/zarafa-search/ECIndexImporter.cpp zarafa-7.1.10/ECtools/zarafa-search/ECIndexImporter.cpp
|
|
--- zarafa-7.1.10.orig/ECtools/zarafa-search/ECIndexImporter.cpp 2014-06-28 01:27:40.777120070 +0200
|
|
+++ zarafa-7.1.10/ECtools/zarafa-search/ECIndexImporter.cpp 2014-06-28 01:27:54.902119472 +0200
|
|
@@ -47,6 +47,7 @@
|
|
*
|
|
*/
|
|
|
|
+#include <memory>
|
|
#include "platform.h"
|
|
|
|
#include "ECIndexImporter.h"
|