summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2016-11-04 10:51:35 +0000
committerjsing <jsing@openbsd.org>2016-11-04 10:51:35 +0000
commitf616df6f43855ea57d971d17a3c6d7c0fef741be (patch)
tree7f491514d9cb3a95c2fc1dae1def78da159c8ce2
parentRename the internal bio related functions so that they have a common (diff)
downloadwireguard-openbsd-f616df6f43855ea57d971d17a3c6d7c0fef741be.tar.xz
wireguard-openbsd-f616df6f43855ea57d971d17a3c6d7c0fef741be.zip
Do not mix declarations and code.
-rw-r--r--lib/libtls/tls_bio_cb.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/libtls/tls_bio_cb.c b/lib/libtls/tls_bio_cb.c
index b36018761d6..b85c1c606a2 100644
--- a/lib/libtls/tls_bio_cb.c
+++ b/lib/libtls/tls_bio_cb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls_bio_cb.c,v 1.7 2016/11/04 10:50:32 jsing Exp $ */
+/* $OpenBSD: tls_bio_cb.c,v 1.8 2016/11/04 10:51:35 jsing Exp $ */
/*
* Copyright (c) 2016 Tobias Pape <tobias@netshed.de>
*
@@ -168,8 +168,10 @@ static int
tls_bio_write_cb(BIO *h, const char *buf, int num, void *cb_arg)
{
struct tls *ctx = cb_arg;
+ int rv;
+
BIO_clear_retry_flags(h);
- int rv = (ctx->write_cb)(ctx, buf, num, ctx->cb_arg);
+ rv = (ctx->write_cb)(ctx, buf, num, ctx->cb_arg);
if (rv == TLS_WANT_POLLIN) {
BIO_set_retry_read(h);
rv = -1;
@@ -184,8 +186,10 @@ static int
tls_bio_read_cb(BIO *h, char *buf, int size, void *cb_arg)
{
struct tls *ctx = cb_arg;
+ int rv;
+
BIO_clear_retry_flags(h);
- int rv = (ctx->read_cb)(ctx, buf, size, ctx->cb_arg);
+ rv = (ctx->read_cb)(ctx, buf, size, ctx->cb_arg);
if (rv == TLS_WANT_POLLIN) {
BIO_set_retry_read(h);
rv = -1;