From 53091e3bce487ee82e2805a0231e780551561717 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sun, 12 Mar 2017 19:39:01 +0000 Subject: Adapt to skalibs-2.5.0.0 --- src/stls/stls_run.c | 25 ++++++++++++------------- src/stls/stls_s6tlsc.c | 1 - src/stls/stls_s6tlsd.c | 1 - 3 files changed, 12 insertions(+), 15 deletions(-) (limited to 'src/stls') diff --git a/src/stls/stls_run.c b/src/stls/stls_run.c index 0ba10b0..8d7478f 100644 --- a/src/stls/stls_run.c +++ b/src/stls/stls_run.c @@ -1,7 +1,7 @@ /* ISC license. */ #include -#include +#include #include #include #include @@ -16,7 +16,6 @@ #include #include #include -#include #include typedef struct tlsbuf_s tlsbuf_t, *tlsbuf_t_ref ; @@ -29,10 +28,10 @@ struct tlsbuf_s static inline int buffer_tls_flush (struct tls *ctx, tlsbuf_t *b) { - siovec_t v[2] ; + struct iovec v[2] ; ssize_t r, w ; buffer_rpeek(&b[0].b, v) ; - r = tls_write(ctx, v[0].s, v[0].len) ; + r = tls_write(ctx, v[0].iov_base, v[0].iov_len) ; switch (r) { case -1 : return -1 ; @@ -43,9 +42,9 @@ static inline int buffer_tls_flush (struct tls *ctx, tlsbuf_t *b) default : break ; } w = r ; - if ((size_t)w == v[0].len && v[1].len) + if ((size_t)w == v[0].iov_len && v[1].iov_len) { - r = tls_write(ctx, v[1].s, v[1].len) ; + r = tls_write(ctx, v[1].iov_base, v[1].iov_len) ; switch (r) { case TLS_WANT_POLLIN : @@ -65,11 +64,11 @@ static inline int buffer_tls_flush (struct tls *ctx, tlsbuf_t *b) static inline int buffer_tls_fill (struct tls *ctx, tlsbuf_t *b) { - siovec_t v[2] ; + struct iovec v[2] ; ssize_t r, w ; int ok = 1 ; buffer_wpeek(&b[1].b, v) ; - r = tls_read(ctx, v[0].s, v[0].len) ; + r = tls_read(ctx, v[0].iov_base, v[0].iov_len) ; switch (r) { case 0 : return -2 ; @@ -81,9 +80,9 @@ static inline int buffer_tls_fill (struct tls *ctx, tlsbuf_t *b) default : break ; } w = r ; - if ((size_t)w == v[0].len && v[1].len) + if ((size_t)w == v[0].iov_len && v[1].iov_len) { - r = tls_read(ctx, v[1].s, v[1].len) ; + r = tls_read(ctx, v[1].iov_base, v[1].iov_len) ; switch (r) { case TLS_WANT_POLLOUT : @@ -121,9 +120,9 @@ int stls_run (struct tls *ctx, int *fds, unsigned int verbosity, uint32_t option tlsbuf_t b[2] = { { .blockedonother = 0 }, { .blockedonother = 0 } } ; iopause_fd x[4] ; unsigned int xindex[4] ; - register unsigned int i ; + unsigned int i = 0 ; - for (i = 0 ; i < 2 ; i++) + for (; i < 2 ; i++) { buffer_init(&b[i].b, i ? &buffer_write : &buffer_read, fds[i], b[i].buf, STLS_BUFSIZE) ; if (ndelay_on(fds[2+i]) < 0) strerr_diefu1sys(111, "set fds non-blocking") ; @@ -136,7 +135,7 @@ int stls_run (struct tls *ctx, int *fds, unsigned int verbosity, uint32_t option { tain_t deadline ; unsigned int xlen = 0 ; - register int r ; + int r ; tain_add_g(&deadline, fds[0] >= 0 && fds[2] >= 0 && buffer_isempty(&b[0].b) && buffer_isempty(&b[1].b) ? tto : &tain_infinite_relative) ; diff --git a/src/stls/stls_s6tlsc.c b/src/stls/stls_s6tlsc.c index 001953d..ed0476e 100644 --- a/src/stls/stls_s6tlsc.c +++ b/src/stls/stls_s6tlsc.c @@ -1,6 +1,5 @@ /* ISC license. */ -#include #include #include #include diff --git a/src/stls/stls_s6tlsd.c b/src/stls/stls_s6tlsd.c index 4b04560..aac188e 100644 --- a/src/stls/stls_s6tlsd.c +++ b/src/stls/stls_s6tlsd.c @@ -1,6 +1,5 @@ /* ISC license. */ -#include #include #include #include -- cgit v1.2.3