|
a/src/internfile/internfile.cpp |
|
b/src/internfile/internfile.cpp |
|
... |
|
... |
156 |
// Has mime: check for a compressed file. If so, create a
|
156 |
// Has mime: check for a compressed file. If so, create a
|
157 |
// temporary uncompressed file, and rerun the mime type
|
157 |
// temporary uncompressed file, and rerun the mime type
|
158 |
// identification, then do the rest with the temp file.
|
158 |
// identification, then do the rest with the temp file.
|
159 |
list<string>ucmd;
|
159 |
list<string>ucmd;
|
160 |
if (m_cfg->getUncompressor(l_mime, ucmd)) {
|
160 |
if (m_cfg->getUncompressor(l_mime, ucmd)) {
|
|
|
161 |
// Check for compressed size limit
|
|
|
162 |
int maxkbs = -1;
|
|
|
163 |
if (!m_cfg->getConfParam("compressedfilemaxkbs", &maxkbs) ||
|
|
|
164 |
maxkbs < 0 || !stp || int(stp->st_size / 1024) < maxkbs) {
|
161 |
if (!uncompressfile(m_cfg, m_fn, ucmd, m_tdir, m_tfile)) {
|
165 |
if (!uncompressfile(m_cfg, m_fn, ucmd, m_tdir, m_tfile)) {
|
162 |
return;
|
166 |
return;
|
|
|
167 |
}
|
|
|
168 |
LOGDEB1(("internfile: after ucomp: m_tdir %s, tfile %s\n",
|
|
|
169 |
m_tdir.c_str(), m_tfile.c_str()));
|
|
|
170 |
m_fn = m_tfile;
|
|
|
171 |
// Note: still using the original file's stat. right ?
|
|
|
172 |
l_mime = mimetype(m_fn, stp, m_cfg, usfci);
|
|
|
173 |
if (l_mime.empty() && imime)
|
|
|
174 |
l_mime = *imime;
|
|
|
175 |
} else {
|
|
|
176 |
LOGINFO(("internfile: %s over size limit %d kbs\n",
|
|
|
177 |
m_fn.c_str(), maxkbs));
|
163 |
}
|
178 |
}
|
164 |
LOGDEB1(("internfile: after ucomp: m_tdir %s, tfile %s\n",
|
|
|
165 |
m_tdir.c_str(), m_tfile.c_str()));
|
|
|
166 |
m_fn = m_tfile;
|
|
|
167 |
// Note: still using the original file's stat. right ?
|
|
|
168 |
l_mime = mimetype(m_fn, stp, m_cfg, usfci);
|
|
|
169 |
if (l_mime.empty() && imime)
|
|
|
170 |
l_mime = *imime;
|
|
|
171 |
}
|
179 |
}
|
172 |
}
|
180 |
}
|
173 |
|
181 |
|
174 |
if (l_mime.empty()) {
|
182 |
if (l_mime.empty()) {
|
175 |
// No mime type. We let it through as config may warrant that
|
183 |
// No mime type. We let it through as config may warrant that
|