Switch to unified view

a/src/internfile/mh_execm.cpp b/src/internfile/mh_execm.cpp
...
...
48
    }
48
    }
49
49
50
    // Command name
50
    // Command name
51
    string cmd = params.front();
51
    string cmd = params.front();
52
    
52
    
53
    // Build parameter list: delete cmd name
53
    m_maxmemberkb = 50000;
54
    vector<string>::iterator it = params.begin();
54
    m_config->getConfParam("maxmemberkb", &m_maxmemberkb);
55
    vector<string>myparams(++it, params.end());
55
    ostringstream oss;
56
    oss << "RECOLL_FILTER_MAXMEMBERKB=" << m_maxmemberkb;
57
    m_cmd.putenv(oss.str());
56
58
57
    // Start filter
58
    m_cmd.putenv(m_forPreview ? "RECOLL_FILTER_FORPREVIEW=yes" :
59
    m_cmd.putenv(m_forPreview ? "RECOLL_FILTER_FORPREVIEW=yes" :
59
        "RECOLL_FILTER_FORPREVIEW=no");
60
        "RECOLL_FILTER_FORPREVIEW=no");
61
62
    // Build parameter list: delete cmd name
63
    vector<string>myparams(params.begin() + 1, params.end());
64
60
    if (m_cmd.startExec(cmd, myparams, 1, 1) < 0) {
65
    if (m_cmd.startExec(cmd, myparams, 1, 1) < 0) {
61
        m_reason = string("RECFILTERROR HELPERNOTFOUND ") + cmd;
66
        m_reason = string("RECFILTERROR HELPERNOTFOUND ") + cmd;
62
        missingHelper = true;
67
        missingHelper = true;
63
        return false;
68
        return false;
64
    }
69
    }
...
...
114
        LOGERR(("MHExecMultiple: bad line in filter output: [%s]\n",
119
        LOGERR(("MHExecMultiple: bad line in filter output: [%s]\n",
115
                ibuf.c_str()));
120
                ibuf.c_str()));
116
        return false;
121
        return false;
117
    }
122
    }
118
    LOGDEB1(("MHExecMultiple: got name [%s] len: %d\n", name.c_str(), len));
123
    LOGDEB1(("MHExecMultiple: got name [%s] len: %d\n", name.c_str(), len));
119
124
    if (len / 1024 > m_maxmemberkb) {
125
        LOGERR(("MHExecMultiple: data len > maxmemberkb\n"));
126
        return false;
127
    }
128
    
120
    // Hack: check for 'Document:' and read directly the document data
129
    // Hack: check for 'Document:' and read directly the document data
121
    // to m_metaData[cstr_dj_keycontent] to avoid an extra copy of the bulky
130
    // to m_metaData[cstr_dj_keycontent] to avoid an extra copy of the bulky
122
    // piece
131
    // piece
123
    string *datap = &data;
132
    string *datap = &data;
124
    if (!stringlowercmp("document:", name)) {
133
    if (!stringlowercmp("document:", name)) {
...
...
295
304
296
    if (!m_metaData[cstr_dj_keymt].compare(cstr_textplain)) {
305
    if (!m_metaData[cstr_dj_keymt].compare(cstr_textplain)) {
297
    (void)txtdcode("mh_execm");
306
    (void)txtdcode("mh_execm");
298
    }
307
    }
299
    
308
    
300
    
301
    if (eofnext_received)
309
    if (eofnext_received)
302
        m_havedoc = false;
310
        m_havedoc = false;
303
311
304
    LOGDEB0(("MHExecMultiple: returning %d bytes of content,"
312
    LOGDEB0(("MHExecMultiple: returning %d bytes of content,"
305
        " mtype [%s] charset [%s]\n", m_metaData[cstr_dj_keycontent].size(), 
313
        " mtype [%s] charset [%s]\n", m_metaData[cstr_dj_keycontent].size(),