mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
BUG/MEDIUM: spoe: Always retry when an applet fails to send a frame
This bug is related to the previous one ("BUG/MEDIUM: spoe: Always retry when an applet fails to send a frame"). applet_putblk() function retruns -1 on error and it should always be interpreted as a missing of room in the buffer. However, on the spoe, this was processed as an I/O error. This patch must be backported as far as 2.8.
This commit is contained in:
parent
40aa87a28f
commit
4fd656e311
@ -1131,7 +1131,6 @@ spoe_handle_healthcheck_response(char *frame, size_t size, char *err, int errlen
|
|||||||
static int
|
static int
|
||||||
spoe_send_frame(struct appctx *appctx, char *buf, size_t framesz)
|
spoe_send_frame(struct appctx *appctx, char *buf, size_t framesz)
|
||||||
{
|
{
|
||||||
struct stconn *sc = appctx_sc(appctx);
|
|
||||||
int ret;
|
int ret;
|
||||||
uint32_t netint;
|
uint32_t netint;
|
||||||
|
|
||||||
@ -1140,15 +1139,8 @@ spoe_send_frame(struct appctx *appctx, char *buf, size_t framesz)
|
|||||||
netint = htonl(framesz);
|
netint = htonl(framesz);
|
||||||
memcpy(buf, (char *)&netint, 4);
|
memcpy(buf, (char *)&netint, 4);
|
||||||
ret = applet_putblk(appctx, buf, framesz+4);
|
ret = applet_putblk(appctx, buf, framesz+4);
|
||||||
if (ret <= 0) {
|
if (ret <= 0)
|
||||||
if (ret == -3 && b_is_null(&sc_ic(sc)->buf)) {
|
return 1; /* retry */
|
||||||
/* WT: is this still needed for the case ret==-3 ? */
|
|
||||||
sc_need_room(sc, 0);
|
|
||||||
return 1; /* retry */
|
|
||||||
}
|
|
||||||
SPOE_APPCTX(appctx)->status_code = SPOE_FRM_ERR_IO;
|
|
||||||
return -1; /* error */
|
|
||||||
}
|
|
||||||
return framesz;
|
return framesz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user