commit c8feccb92d14672750b8854658498642280f2a24
parent 62e0f7b6f493f49ccd40a6cd32d3d9544956f9e5
Author: Andrew Kloet <andrew@kloet.net>
Date: Mon, 27 Apr 2026 13:16:41 -0400
improve error message
Diffstat:
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/cio.c b/cio.c
@@ -1020,14 +1020,14 @@ main(int argc, char *argv[])
}
if (FD_ISSET(srv.fd, &rfs)) {
if (!srd()) {
- die("cio: read error:");
+ die("cio: connection closed by remote host");
}
}
if (FD_ISSET(srv.fd, &wfs)) {
size_t len = outp - outb;
int wr = ssl ? SSL_write(srv.ssl, outb, len) : write(srv.fd, outb, len);
if (wr <= 0) {
- die("cio: write error:");
+ die("cio: write failed: connection lost");
}
outp -= wr;
memmove(outb, outb + wr, outp - outb);
diff --git a/patches/colornames.diff b/patches/colornames.diff
@@ -1,5 +1,6 @@
cio.c | 30 ++++++++++++++++++++++++++----
1 file changed, 26 insertions(+), 4 deletions(-)
+
diff --git a/cio.c b/cio.c
index fe90dc3..4470d43 100644
--- a/cio.c
diff --git a/patches/reconnect.diff b/patches/reconnect.diff
@@ -62,7 +62,7 @@ index fe90dc3..f7d3bdc 100644
+ }
if (FD_ISSET(srv.fd, &rfs)) {
if (!srd()) {
-- die("cio: read error:");
+- die("cio: connection closed by remote host");
+ reconn = 1;
+ continue;
}
@@ -71,7 +71,7 @@ index fe90dc3..f7d3bdc 100644
size_t len = outp - outb;
int wr = ssl ? SSL_write(srv.ssl, outb, len) : write(srv.fd, outb, len);
if (wr <= 0) {
-- die("cio: write error:");
+- die("cio: write failed: connection lost");
+ reconn = 1;
+ continue;
}