Skip to content

Commit 743afee

Browse files
EmericBrcapflam
authored andcommitted
BUG/MINOR: dns: missing test writing in output channel in session handler
This patch fix a case which should never happen writing in output channel since we check available room before This patch should fix github issue haproxy#1132
1 parent 526b792 commit 743afee

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/dns.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,15 @@ static void dns_session_io_handler(struct appctx *appctx)
592592
}
593593
trash.data += len;
594594

595-
ci_putchk(si_ic(si), &trash);
595+
if (ci_putchk(si_ic(si), &trash) == -1) {
596+
/* should never happen since we
597+
* check available_room is large
598+
* enought here.
599+
*/
600+
si_rx_room_blk(si);
601+
ret = 0;
602+
break;
603+
}
596604

597605
if (ds->tx_msg_offset) {
598606
/* msg was not fully processed, we must be awake to drain pending data */

0 commit comments

Comments
 (0)