mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-28 22:31:06 +01:00
[MEDIUM] session: also consider request analysers added during response
A request analyser may very well be added while processing a response (eg: end of an HTTP keep-alive response). It's very dangerous to only rely on flags that ought to change in order to loop back, so let's correctly detect a possible new analyser addition instead of guessing.
This commit is contained in:
parent
1e0bbafcbe
commit
576507f4c5
@ -648,6 +648,7 @@ struct task *process_session(struct task *t)
|
|||||||
{
|
{
|
||||||
struct session *s = t->context;
|
struct session *s = t->context;
|
||||||
unsigned int rqf_last, rpf_last;
|
unsigned int rqf_last, rpf_last;
|
||||||
|
unsigned int req_ana_back;
|
||||||
|
|
||||||
//DPRINTF(stderr, "%s:%d: cs=%d ss=%d(%d) rqf=0x%08x rpf=0x%08x\n", __FUNCTION__, __LINE__,
|
//DPRINTF(stderr, "%s:%d: cs=%d ss=%d(%d) rqf=0x%08x rpf=0x%08x\n", __FUNCTION__, __LINE__,
|
||||||
// s->si[0].state, s->si[1].state, s->si[1].err_type, s->req->flags, s->rep->flags);
|
// s->si[0].state, s->si[1].state, s->si[1].err_type, s->req->flags, s->rep->flags);
|
||||||
@ -916,6 +917,12 @@ resync_stream_interface:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* we'll monitor the request analysers while parsing the response,
|
||||||
|
* because some response analysers may indirectly enable new request
|
||||||
|
* analysers (eg: HTTP keep-alive).
|
||||||
|
*/
|
||||||
|
req_ana_back = s->req->analysers;
|
||||||
|
|
||||||
resync_response:
|
resync_response:
|
||||||
/* Analyse response */
|
/* Analyse response */
|
||||||
|
|
||||||
@ -990,6 +997,10 @@ resync_stream_interface:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* maybe someone has added some request analysers, so we must check and loop */
|
||||||
|
if (s->req->analysers & ~req_ana_back)
|
||||||
|
goto resync_request;
|
||||||
|
|
||||||
/* FIXME: here we should call protocol handlers which rely on
|
/* FIXME: here we should call protocol handlers which rely on
|
||||||
* both buffers.
|
* both buffers.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user