diff options
author | Willy Tarreau <w@1wt.eu> | 2017-08-18 09:43:41 +0200 |
---|---|---|
committer | Willy Tarreau <w@1wt.eu> | 2017-08-18 13:42:05 +0200 |
commit | 646a0a7145f150288f42f582f62a6209059c6681 (patch) | |
tree | 9e42aee33137e8d99d4fb81249ad206599c0ddfd | |
parent | e193ab2383ce8900f7d070d920a7c873b1662356 (diff) | |
download | haproxy-646a0a7145f150288f42f582f62a6209059c6681.tar.gz |
WIP/BUG/MEDIUM: h2: mark the h2c appctx as "cant_put" when the buffer is full
Without this we get long pauses during the page load especially when debug
output is in use and slows down progress (or simply by placing usleep(20000)
at the top of debug_hexdump()).
It's not normal that the flags are not set at the moment where the data
fail to be written, so certain things need to be revisited on the write
path here.
-rw-r--r-- | src/h2ch1.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/h2ch1.c b/src/h2ch1.c index f611076dc..8d69885ba 100644 --- a/src/h2ch1.c +++ b/src/h2ch1.c @@ -1848,6 +1848,8 @@ static int h2c_frt_process_frames(struct h2c *h2c, struct h2s *only_h2s) * move on the H2C side. */ if (only_h2s) { + if ((si_ic(si)->buf->i + si_ic(si)->buf->o) || (si_ic(si)->flags & CF_SHUTW_NOW)) + si_applet_cant_put(si); si_applet_wake_cb(si); channel_release_buffer(si_ic(si), &appctx->buffer_wait); } @@ -1861,6 +1863,8 @@ static int h2c_frt_process_frames(struct h2c *h2c, struct h2s *only_h2s) * move on the H2C side. */ if (only_h2s) { + if ((si_ic(si)->buf->i + si_ic(si)->buf->o) || (si_ic(si)->flags & CF_SHUTW_NOW)) + si_applet_cant_put(si); si_applet_wake_cb(si); channel_release_buffer(si_ic(si), &appctx->buffer_wait); } |