search/index: fixed a number of bad conversions to properly deal with text documents bigger than 2GB
This commit is contained in:
@@ -108,8 +108,8 @@ public:
|
||||
return -1;
|
||||
}
|
||||
if (fseeko(fp, cacheoffset(msgnum), SEEK_SET) != 0) {
|
||||
LOGDEB0(("MboxCache::get_offsets: seek %ld errno %d\n",
|
||||
(long)cacheoffset(msgnum), errno));
|
||||
LOGDEB0(("MboxCache::get_offsets: seek %lld errno %d\n",
|
||||
cacheoffset(msgnum), errno));
|
||||
return -1;
|
||||
}
|
||||
mbhoff_type offset = -1;
|
||||
|
||||
@@ -69,11 +69,13 @@ bool MimeHandlerText::set_document_file(const string &fn)
|
||||
}
|
||||
m_pagesz = size_t(ps);
|
||||
string reason;
|
||||
LOGDEB(("calling file_to_string\n"));
|
||||
// file_to_string() takes pagesz == size_t(-1) to mean read all.
|
||||
if (!file_to_string(fn, m_text, 0, m_pagesz, &reason)) {
|
||||
LOGERR(("MimeHandlerText: can't read file: %s\n", reason.c_str()));
|
||||
return false;
|
||||
}
|
||||
LOGDEB(("file_to_string OK\n"));
|
||||
m_offs = m_text.length();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user