Switch to unified view

a/src/internfile/mh_execm.cpp b/src/internfile/mh_execm.cpp
...
...
179
179
180
    // Read answer (multiple elements)
180
    // Read answer (multiple elements)
181
    LOGDEB1(("MHExecMultiple: reading answer\n"));
181
    LOGDEB1(("MHExecMultiple: reading answer\n"));
182
    bool eofnext_received = false;
182
    bool eofnext_received = false;
183
    bool eofnow_received = false;
183
    bool eofnow_received = false;
184
    bool fileerror_received = false;
185
    bool subdocerror_received = false;
184
    string ipath;
186
    string ipath;
185
    string mtype;
187
    string mtype;
186
    for (int loop=0;;loop++) {
188
    for (int loop=0;;loop++) {
187
        string name, data;
189
        string name, data;
188
        if (!readDataElement(name, data)) {
190
        if (!readDataElement(name, data)) {
...
...
192
        if (name.empty())
194
        if (name.empty())
193
            break;
195
            break;
194
        if (!stringlowercmp("eofnext:", name)) {
196
        if (!stringlowercmp("eofnext:", name)) {
195
            LOGDEB(("MHExecMultiple: got EOFNEXT\n"));
197
            LOGDEB(("MHExecMultiple: got EOFNEXT\n"));
196
            eofnext_received = true;
198
            eofnext_received = true;
197
        }
198
        if (!stringlowercmp("eofnow:", name)) {
199
        } else if (!stringlowercmp("eofnow:", name)) {
199
            LOGDEB(("MHExecMultiple: got EOFNOW\n"));
200
            LOGDEB(("MHExecMultiple: got EOFNOW\n"));
200
            eofnow_received = true;
201
            eofnow_received = true;
201
        }
202
        } else if (!stringlowercmp("subdocerror:", name)) {
203
            LOGDEB(("MHExecMultiple: got SUBDOCERROR\n"));
204
      subdocerror_received = true;
205
        } else if (!stringlowercmp("fileerror:", name)) {
206
            LOGDEB(("MHExecMultiple: got FILEERROR\n"));
207
      fileerror_received = true;
208
        } else if (!stringlowercmp("subdocerror:", name)) {
209
            LOGDEB(("MHExecMultiple: got SUBDOCERROR\n"));
210
      return false;
202
        if (!stringlowercmp("ipath:", name)) {
211
        } else if (!stringlowercmp("ipath:", name)) {
203
            ipath = data;
212
            ipath = data;
204
            LOGDEB(("MHExecMultiple: got ipath [%s]\n", data.c_str()));
213
            LOGDEB(("MHExecMultiple: got ipath [%s]\n", data.c_str()));
205
        }
206
        if (!stringlowercmp("mimetype:", name)) {
214
        } else if (!stringlowercmp("mimetype:", name)) {
207
            mtype = data;
215
            mtype = data;
208
            LOGDEB(("MHExecMultiple: got mimetype [%s]\n", data.c_str()));
216
            LOGDEB(("MHExecMultiple: got mimetype [%s]\n", data.c_str()));
209
        }
217
        }
210
        if (loop == 10) {
218
        if (loop == 10) {
211
            // ?? 
219
            // ?? 
212
            LOGERR(("MHExecMultiple: filter sent too many parameters\n"));
220
            LOGERR(("MHExecMultiple: filter sent too many parameters\n"));
213
            return false;
221
            return false;
214
        }
222
        }
215
    }
223
    }
216
224
217
    if (eofnow_received) {
225
    if (eofnow_received || fileerror_received) {
218
        // No more docs
226
        // No more docs
219
        m_havedoc = false;
227
        m_havedoc = false;
220
        return false;
228
        return false;
229
    }
230
    if (subdocerror_received) {
231
  return false;
221
    }
232
    }
222
233
223
    // It used to be that eof could be signalled just by an empty document, but
234
    // It used to be that eof could be signalled just by an empty document, but
224
    // this was wrong. Empty documents can be found ie in zip files and should 
235
    // this was wrong. Empty documents can be found ie in zip files and should 
225
    // not be interpreted as eof.
236
    // not be interpreted as eof.