summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/constraint.c
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2015-09-10 10:34:20 +0000
committerBob Beck <beck@cvs.openbsd.org>2015-09-10 10:34:20 +0000
commitb559ad8e5ab2e919b5dc01ea661824372eaff08e (patch)
treed2ec1898ae9f2afc2bfb7ffbe79b65a229c74bc3 /usr.sbin/ntpd/constraint.c
parent948487fd12af0e2818cf21ce131881c42551085b (diff)
fix after libtls api changes
ok jsing@
Diffstat (limited to 'usr.sbin/ntpd/constraint.c')
-rw-r--r--usr.sbin/ntpd/constraint.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/usr.sbin/ntpd/constraint.c b/usr.sbin/ntpd/constraint.c
index 733f2d88ee1..b313a308a39 100644
--- a/usr.sbin/ntpd/constraint.c
+++ b/usr.sbin/ntpd/constraint.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: constraint.c,v 1.15 2015/09/09 15:05:58 millert Exp $ */
+/* $OpenBSD: constraint.c,v 1.16 2015/09/10 10:34:19 beck Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
@@ -661,13 +661,13 @@ httpsdate_request(struct httpsdate *httpsdate, struct timeval *when)
buf = httpsdate->tls_request;
len = strlen(httpsdate->tls_request);
while (len > 0) {
- ret = tls_write(httpsdate->tls_ctx, buf, len, &outlen);
- if (ret == TLS_READ_AGAIN || ret == TLS_WRITE_AGAIN)
+ ret = tls_write(httpsdate->tls_ctx, buf, len);
+ if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT)
continue;
if (ret < 0)
goto fail;
- buf += outlen;
- len -= outlen;
+ buf += ret;
+ len -= ret;
}
while ((line = tls_readline(httpsdate->tls_ctx, &outlen,
@@ -742,7 +742,7 @@ char *
tls_readline(struct tls *tls, size_t *lenp, size_t *maxlength,
struct timeval *when)
{
- size_t i, len, nr;
+ size_t i, len;
char *buf, *q, c;
int ret;
@@ -757,8 +757,8 @@ tls_readline(struct tls *tls, size_t *lenp, size_t *maxlength,
len *= 2;
}
again:
- ret = tls_read(tls, &c, 1, &nr);
- if (ret == TLS_READ_AGAIN)
+ ret = tls_read(tls, &c, 1);
+ if (ret == TLS_WANT_POLLIN || ret == TLS_WANT_POLLOUT)
goto again;
if (ret != 0) {
/* SSL read error, ignore */