BUG/MEDIUM: dns: Properly handle error when a response consumed

When a response is consumed, result for co_getblk() is never checked. It
seems ok because amount of output data is always checked first. But There is
an issue when we try to get the first 2 bytes to read the message length. If
there is only one byte followed by a shutdown, the applet ignore the
shutdown and loop till the timeout to get more data.

So to avoid any issue and improve shutdown detection, the co_getblk() return
value is always tested. In addition, if there is not enough data, the applet
explicitly ask for more data by calling applet_need_more_data().

This patch relies on the previous one:

   * BUG/MEDIUM: channel: Improve reports for shut in co_getblk()

Both should be backported as far as 2.4. On 2.5 and 2.4,
applet_need_more_data() must be replaced by si_rx_endp_more().

(cherry picked from commit 28975e1e1012e4a009b4208f3fc022ea2bfb8b82)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit dc608287aedf7fe65a49fca27d933882790513c5)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 10a19f1841d759732ce59a7e64770fa887049b54)
[cf: In fact applet_need_more_data() must be replaced by si_cant_get()]
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit fad221e24604a68d17044f7c4ca3d95143a722f6)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
1 file changed