summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-07-06 11:51:51 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-07-06 11:54:22 -0700
commit32ff4cabe80a1ec7ba7f72cbc2dd46ac921682da (patch)
treee33a2682cdacccca6a36c174a275dba90dcf7b5a /src/modules
parent210b635371619638207d3602249aa52a6ec849c5 (diff)
modules/rkt: fix scener send error handling
Silly typo, one of those fun C instances where it's surprising how silently mostly-working such a blatant mistake can be. For posterity: The way this was even observed as having an affect is while verifying graceful handling of connections broken while in the listen backlog. With an active scener session idle at the prompt, start another telnet, connecting without receiving any banner (queued via backlog), ^]cl that backlogged telnet. Then start another telnet in the same way. Now go to the idle scener session and quit. The latest telnet would just sit there, seemingly blocked behind the broken-while-backlogged connection. But what was really happening was the banner send got the error on the broken connection after accepting, as you'd expect. This bug in the errno tests prevented detecting the genuine error though, leaving the broken session connected indefinitely. Fun!
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/rkt/rkt_scener.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/rkt/rkt_scener.c b/src/modules/rkt/rkt_scener.c
index 8f134bb..e8fa67f 100644
--- a/src/modules/rkt/rkt_scener.c
+++ b/src/modules/rkt/rkt_scener.c
@@ -735,7 +735,7 @@ int rkt_scener_update(rkt_context_t *ctxt)
ret = send(scener->client, &buf[scener->output_pos], len - scener->output_pos, MSG_NOSIGNAL);
if (ret == -1) {
- if (errno == EAGAIN || EWOULDBLOCK)
+ if (errno == EAGAIN || errno == EWOULDBLOCK)
return 0;
return rkt_scener_err_close(scener, errno);
© All Rights Reserved