diff options
author | deraadt <> | 2019-06-20 15:47:44 +0000 |
---|---|---|
committer | deraadt <> | 2019-06-20 15:47:44 +0000 |
commit | d4136d28647e8c89283a354ff6f0789d85a45bff (patch) | |
tree | 4d5ecf3e797ce3dd93895c5f483711c34f87c941 /src | |
parent | 52a29ff38f224919bb97c3cc22ec08682b47cb94 (diff) | |
download | openbsd-d4136d28647e8c89283a354ff6f0789d85a45bff.tar.gz openbsd-d4136d28647e8c89283a354ff6f0789d85a45bff.tar.bz2 openbsd-d4136d28647e8c89283a354ff6f0789d85a45bff.zip |
tls_read() & tls_write() return 4 possible values: TLS_WANT_POLLOUT,
TLS_WANT_POLLIN, -1, or 0. After handling the first two, check for -1
rather than vaguely "< 0".
ok jsing
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libtls/man/tls_read.3 | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libtls/man/tls_read.3 b/src/lib/libtls/man/tls_read.3 index e890357a9f..b0811f4aa0 100644 --- a/src/lib/libtls/man/tls_read.3 +++ b/src/lib/libtls/man/tls_read.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: tls_read.3,v 1.5 2019/03/20 14:17:19 espie Exp $ | 1 | .\" $OpenBSD: tls_read.3,v 1.6 2019/06/20 15:47:44 deraadt Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2014, 2015 Ted Unangst <tedu@openbsd.org> | 3 | .\" Copyright (c) 2014, 2015 Ted Unangst <tedu@openbsd.org> |
4 | .\" Copyright (c) 2015 Doug Hogan <doug@openbsd.org> | 4 | .\" Copyright (c) 2015 Doug Hogan <doug@openbsd.org> |
@@ -18,7 +18,7 @@ | |||
18 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 18 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
19 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 19 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
20 | .\" | 20 | .\" |
21 | .Dd $Mdocdate: March 20 2019 $ | 21 | .Dd $Mdocdate: June 20 2019 $ |
22 | .Dt TLS_READ 3 | 22 | .Dt TLS_READ 3 |
23 | .Os | 23 | .Os |
24 | .Sh NAME | 24 | .Sh NAME |
@@ -163,7 +163,7 @@ while (len > 0) { | |||
163 | ret = tls_write(ctx, buf, len); | 163 | ret = tls_write(ctx, buf, len); |
164 | if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT) | 164 | if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT) |
165 | continue; | 165 | continue; |
166 | if (ret < 0) | 166 | if (ret == -1) |
167 | errx(1, "tls_write: %s", tls_error(ctx)); | 167 | errx(1, "tls_write: %s", tls_error(ctx)); |
168 | buf += ret; | 168 | buf += ret; |
169 | len -= ret; | 169 | len -= ret; |
@@ -192,7 +192,7 @@ while (len > 0) { | |||
192 | pfd[0].events = POLLIN; | 192 | pfd[0].events = POLLIN; |
193 | else if (ret == TLS_WANT_POLLOUT) | 193 | else if (ret == TLS_WANT_POLLOUT) |
194 | pfd[0].events = POLLOUT; | 194 | pfd[0].events = POLLOUT; |
195 | else if (ret < 0) | 195 | else if (ret == -1) |
196 | errx(1, "tls_write: %s", tls_error(ctx)); | 196 | errx(1, "tls_write: %s", tls_error(ctx)); |
197 | else { | 197 | else { |
198 | buf += ret; | 198 | buf += ret; |