mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-08 16:23:24 -04:00
BUG/MEDIUM: channel: Fix condition to know if a channel may send
Historically, we considered a channel cannot send before the connection was established. This was useful to know if the reserve should still be respected for the receives. This was because it was possible to rewrite the request on connection retry (because of http-send-name-header option). However noadays, it is a useless limitation. Once data forwarding is started, there is no longer rewrites on the request at the stream layer (http-send-name-header option is handled by the muxes). And, since it is possible to use small buffers to queue requests, it could be an issue, because the reserve and the small buffer size are the same by default. Once a small request was finally dequeued, the receives on client side were not re-armed because we should still respect the reserve on receives (channel_recv_limit() was returning 0 in that case). To fix the issue, we must consider a channel may send since the underlying stconn has reached the SC_ST_REQ state, instead of SC_ST_EST. Doing so, we are able to ignore the reserve earlier and the receives can be re-armed even with small buffers. There is no reason to backport this patch, except if an issue is reported, because only the 3.4 is concerned. But it could theorically be backported to all stable versions.
This commit is contained in:
parent
326618b9a9
commit
1b4255a885
1 changed files with 1 additions and 1 deletions
|
|
@ -422,7 +422,7 @@ static inline int channel_is_rewritable(const struct channel *chn)
|
|||
*/
|
||||
static inline int channel_may_send(const struct channel *chn)
|
||||
{
|
||||
return chn_cons(chn)->state == SC_ST_EST;
|
||||
return chn_cons(chn)->state >= SC_ST_REQ;
|
||||
}
|
||||
|
||||
/* HTX version of channel_may_recv(). Returns non-zero if the channel can still
|
||||
|
|
|
|||
Loading…
Reference in a new issue