srv->roffset = 0;
srv->nextRequestId = 0;
srv->replyXaction = NULL;
+ srv->ignoreToEom = false;
srv->parent = cbdataReference(hlp);
dlinkAddTail(srv, &srv->link, &hlp->servers);
*eom = '\0';
}
- if (!srv->replyXaction) {
+ if (!srv->ignoreToEom && !srv->replyXaction) {
int i = 0;
if (hlp->childs.concurrency) {
char *e = NULL;
i << " from " << hlp->id_name << " #" << srv->index <<
" '" << srv->rbuf << "'");
}
+ srv->ignoreToEom = true;
}
} // else we need to just append reply data to the current Xaction
helperReturnBuffer(srv, hlp, msg, msgSize, eom);
msg += msgSize + skip;
assert(static_cast<size_t>(msg - srv->rbuf) <= srv->rbuf_sz);
+
+ // The next message should not ignored.
+ if (eom && srv->ignoreToEom)
+ srv->ignoreToEom = false;
} else
assert(skip == 0 && eom == NULL);
}
*t = '\0';
}
- if (!r->reply.accumulate(srv->rbuf, t ? (t - srv->rbuf) : srv->roffset)) {
+ if (r && !r->reply.accumulate(srv->rbuf, t ? (t - srv->rbuf) : srv->roffset)) {
debugs(84, DBG_IMPORTANT, "ERROR: Disconnecting from a " <<
"helper that overflowed " << srv->rbuf_sz << "-byte " <<
"Squid input buffer: " << hlp->id_name << " #" << srv->index);
/// the end-of-message for current reply is not retrieved.
Helper::Xaction *replyXaction;
+ /// Whether to ignore current message, because it is timed-out or other reason
+ bool ignoreToEom;
+
// STL says storing std::list iterators is safe when changing the list
typedef std::map<uint64_t, Requests::iterator> RequestIndex;
RequestIndex requestsIndex; ///< maps request IDs to requests