diff options
author | 2015-09-09 19:23:03 +0000 | |
---|---|---|
committer | 2015-09-09 19:23:03 +0000 | |
commit | f3d2d6f659182216234630969ad57a759d2a1cd5 (patch) | |
tree | ffd12e28bdf2e738bd4963ee8d796411efb737a9 | |
parent | sync (diff) | |
download | wireguard-openbsd-f3d2d6f659182216234630969ad57a759d2a1cd5.tar.xz wireguard-openbsd-f3d2d6f659182216234630969ad57a759d2a1cd5.zip |
Make sure we check TLS_WRITE_AGAIN when calling tls_read() and if
tls_read() fails, print the tls_error() rather than just the return value.
ok beck@
-rw-r--r-- | usr.bin/ftp/fetch.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c index ce1a88ff6fd..a4aadcf6bd7 100644 --- a/usr.bin/ftp/fetch.c +++ b/usr.bin/ftp/fetch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fetch.c,v 1.139 2015/07/18 21:50:47 bluhm Exp $ */ +/* $OpenBSD: fetch.c,v 1.140 2015/09/09 19:23:03 jsing Exp $ */ /* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */ /*- @@ -1549,10 +1549,10 @@ SSL_readline(struct tls *tls, size_t *lenp) } again: ret = tls_read(tls, &c, 1, &nr); - if (ret == TLS_READ_AGAIN) + if (ret == TLS_READ_AGAIN || ret == TLS_WRITE_AGAIN) goto again; if (ret != 0) - errx(1, "SSL read error: %u", ret); + errx(1, "SSL read error: %s", tls_error(tls)); buf[i] = c; if (c == '\n') |