int to_forward;
char *errmsg = NULL;
+ /* Don't read the next command if still processing the reponse of the
+ * current one. Just wait. At this stage, errors should be handled by
+ * the response analyzer.
+ */
+ if (s->res.analysers & AN_RES_WAIT_CLI)
+ return 0;
+
if ((s->pcli_flags & ACCESS_LVL_MASK) == ACCESS_LVL_NONE)
s->pcli_flags |= strm_li(s)->bind_conf->level & ACCESS_LVL_MASK;
}
s->res.flags |= CF_WAKE_ONCE; /* need to be called again */
-
- /* remove the XFER_DATA analysers, which forwards all
- * the data, we don't want to forward the next requests
- * We need to add CF_FLT_ANALYZE to abort the forward too.
- */
- req->analysers &= ~(AN_REQ_FLT_XFER_DATA|AN_REQ_WAIT_CLI);
- req->analysers |= AN_REQ_FLT_END|CF_FLT_ANALYZE;
s->res.analysers |= AN_RES_WAIT_CLI;
if (!(s->flags & SF_ASSIGNED)) {
} else if (to_forward == -1 && errmsg) {
/* there was an error during the parsing */
pcli_reply_and_close(s, errmsg);
+ s->req.analysers &= ~AN_REQ_WAIT_CLI;
return 0;
} else if (to_forward == -1 && channel_full(req, global.tune.maxrewrite)) {
/* buffer is full and we didn't catch the end of a command */
if (rep->flags & CF_READ_ERROR) {
pcli_reply_and_close(s, "Can't connect to the target CLI!\n");
+ s->req.analysers &= ~AN_REQ_WAIT_CLI;
s->res.analysers &= ~AN_RES_WAIT_CLI;
return 0;
}
channel_dont_close(&s->req);
if (s->pcli_flags & PCLI_F_PAYLOAD) {
- s->req.analysers |= AN_REQ_WAIT_CLI;
s->res.analysers &= ~AN_RES_WAIT_CLI;
s->req.flags |= CF_WAKE_ONCE; /* need to be called again if there is some command left in the request */
return 0;
s->req.flags |= CF_WAKE_ONCE; /* need to be called again if there is some command left in the request */
- s->req.analysers |= AN_REQ_WAIT_CLI;
s->res.analysers &= ~AN_RES_WAIT_CLI;
/* We must trim any excess data from the response buffer, because we