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...
This commit is contained in:
Omar Polo 2023-08-04 09:52:27 +00:00
parent fcc5a371b1
commit 1b1a6fb7ee
1 changed files with 2 additions and 0 deletions

View File

@ -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;