handle REFILTERROR in execm
This commit is contained in:
@@ -60,6 +60,7 @@ bool MimeHandlerExecMultiple::startCmd()
|
||||
m_cmd.putenv(m_forPreview ? "RECOLL_FILTER_FORPREVIEW=yes" :
|
||||
"RECOLL_FILTER_FORPREVIEW=no");
|
||||
if (m_cmd.startExec(cmd, myparams, 1, 1) < 0) {
|
||||
m_reason = string("RECFILTERROR HELPERNOTFOUND ") + cmd;
|
||||
missingHelper = true;
|
||||
return false;
|
||||
}
|
||||
@@ -90,6 +91,15 @@ bool MimeHandlerExecMultiple::readDataElement(string& name, string &data)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Filters will sometimes abort before entering the real protocol, ie if
|
||||
// a module can't be loaded. Check the special filter error first word:
|
||||
if (ibuf.find("RECFILTERROR ") == 0) {
|
||||
m_reason = ibuf;
|
||||
if (ibuf.find("HELPERNOTFOUND") != string::npos)
|
||||
missingHelper = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
// We're expecting something like Name: len\n
|
||||
list<string> tokens;
|
||||
stringToTokens(ibuf, tokens);
|
||||
|
||||
@@ -68,14 +68,14 @@ class MimeHandlerExecMultiple : public MimeHandlerExec {
|
||||
{}
|
||||
// No resources to clean up, the ExecCmd destructor does it.
|
||||
virtual ~MimeHandlerExecMultiple() {}
|
||||
virtual bool next_document();
|
||||
virtual void clear() {
|
||||
MimeHandlerExec::clear();
|
||||
}
|
||||
virtual bool set_document_file(const string &file_path) {
|
||||
m_filefirst = true;
|
||||
return MimeHandlerExec::set_document_file(file_path);
|
||||
}
|
||||
virtual bool next_document();
|
||||
|
||||
// skip_to and clear inherited from MimeHandlerExec
|
||||
|
||||
private:
|
||||
bool startCmd();
|
||||
bool readDataElement(string& name, string& data);
|
||||
|
||||
Reference in New Issue
Block a user