aboutsummaryrefslogtreecommitdiff
path: root/titan.c
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2023-08-04 09:52:27 +0000
committerOmar Polo <op@omarpolo.com>2023-08-04 09:52:27 +0000
commit1b1a6fb7ee90529dbf0697954ed01f76a65f7d65 (patch)
tree9691cc2946328e8f53ee4190d6bc910a0ad05ba2 /titan.c
parentfcc5a371b135db8bbbb250bf1793ffffd06dc644 (diff)
titan: iomux: return -1 on EOF without receving anything
otherwise it enters an infinite loop where it tries to read, return zero, and tries again...
Diffstat (limited to 'titan.c')
-rw-r--r--titan.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/titan.c b/titan.c
index 62ba57c..e43765a 100644
--- a/titan.c
+++ b/titan.c
@@ -112,6 +112,8 @@ iomux(struct tls *ctx, int fd, const char *in, size_t inlen, char *out,
case -1:
return -1;
case 0:
+ if (outwrote == 0)
+ return -1;
return outwrote;
default:
outwrote += ret;