]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: cache: Use the sedesc to report and detect end of processing
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 31 Mar 2023 08:11:39 +0000 (10:11 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 5 Apr 2023 06:57:05 +0000 (08:57 +0200)
commitf8130b2de25f51bd950a33344f94ed19f3df8b35
tree3f05ee5f23f7b04292dac581baa63ad87bf06885
parent0ffc9d7be33edbb08ca32587c99102a758b3c0ea
MEDIUM: cache: Use the sedesc to report and detect end of processing

We now try, as far as possible, to rely on the SE descriptor to detect end
of processing. Idea is to no longer rely on the channel or the SC to do so.

First, we now set SE_FL_EOS instead of calling and cf_shutr() to report the
end of the stream. It happens when the response is fully sent (SE_FL_EOI is
already set in this case) or when an error is reported. In this last case,
SE_FL_ERROR is also set.

Thanks to this change, it is now possible to detect the applet must only
consume the request waiting for the upper layer releases it. So, if
SE_FL_EOS or SE_FL_ERROR are set, it means the reponse was fully
handled. And if SE_FL_SHR or SE_FL_SHW are set, it means the applet was
released by upper layer and is waiting to be freed.
src/cache.c