commit 1f9a89386f192bcbe4ee06cb05e6f01bdfc2f13d
parent 4b4e3310b4b159b241d85146d3e6ef4cfec0de58
Author: Pavel Renev <an2qzavok@gmail.com>
Date: Tue, 19 Oct 2021 11:56:00 +0000
deal with i/o on hangup channel errors for now
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/gemfetch.c b/gemfetch.c
@@ -61,10 +61,10 @@ main(int argc, char **argv)
fprint(2, "fetching from %s\n", host);
fd = dial(netmkaddr(host, "tcp", "1965"), nil, nil, nil);
- if (fd <=0) sysfatal("dial: %r");
+ if (fd < 0) sysfatal("dial: %r");
memset(&conn, 0, sizeof(conn));
-
+ conn.serverName = host;
tlsfd = tlsClient(fd, &conn);
if (tlsfd < 0) sysfatal("tlsClient: %r");
@@ -89,7 +89,9 @@ main(int argc, char **argv)
t += n;
write(1, buf, n);
}
- if (n < 0) fprint(2, "read: %r\n");
+ // read always returns with "i/o on hangup channel" errstr
+ // TODO: find a way to deal with it
+ // if (n < 0) fprint(2, "read: %r\n");
fprint(2, "total: %ld\n", t);