summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2012-12-18 15:34:08 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2012-12-18 15:34:08 +0000
commit01c447028caca34f5592361a61b67ada604503c6 (patch)
tree87e4dcf5769d45d89e00cd7a431606121aa2f0ac /usr.sbin/relayd
parenta723d0be1c6bb0e87014433322201179817c7675 (diff)
reorder the variables a bit, no functionaly change.
Diffstat (limited to 'usr.sbin/relayd')
-rw-r--r--usr.sbin/relayd/ssl.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/usr.sbin/relayd/ssl.c b/usr.sbin/relayd/ssl.c
index 6688b2fdec8..b5bb33e1563 100644
--- a/usr.sbin/relayd/ssl.c
+++ b/usr.sbin/relayd/ssl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl.c,v 1.16 2010/05/26 13:56:08 nicm Exp $ */
+/* $OpenBSD: ssl.c,v 1.17 2012/12/18 15:34:07 reyk Exp $ */
/*
* Copyright (c) 2006 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -45,11 +45,11 @@ void ssl_cleanup(struct ctl_tcp_event *);
void
ssl_read(int s, short event, void *arg)
{
+ char rbuf[SMALL_READ_BUF_SIZE];
struct ctl_tcp_event *cte = arg;
+ int retry_flag = EV_READ;
+ int ssl_err = 0;
int ret;
- int ssl_err;
- int retry_flag;
- char rbuf[SMALL_READ_BUF_SIZE];
if (event == EV_TIMEOUT) {
cte->host->up = HOST_DOWN;
@@ -59,8 +59,6 @@ ssl_read(int s, short event, void *arg)
}
bzero(rbuf, sizeof(rbuf));
- ssl_err = 0;
- retry_flag = EV_READ;
ret = SSL_read(cte->ssl, rbuf, sizeof(rbuf));
if (ret <= 0) {
@@ -112,10 +110,10 @@ void
ssl_write(int s, short event, void *arg)
{
struct ctl_tcp_event *cte = arg;
+ int retry_flag = EV_WRITE;
+ int ssl_err = 0;
int len;
int ret;
- int ssl_err;
- int retry_flag;
if (event == EV_TIMEOUT) {
cte->host->up = HOST_DOWN;
@@ -125,7 +123,6 @@ ssl_write(int s, short event, void *arg)
}
len = strlen(cte->table->sendbuf);
- retry_flag = EV_WRITE;
ret = SSL_write(cte->ssl, cte->table->sendbuf, len);
if (ret <= 0) {
@@ -160,9 +157,9 @@ void
ssl_connect(int s, short event, void *arg)
{
struct ctl_tcp_event *cte = arg;
+ int retry_flag = 0;
+ int ssl_err = 0;
int ret;
- int ssl_err;
- int retry_flag;
if (event == EV_TIMEOUT) {
cte->host->up = HOST_DOWN;
@@ -171,8 +168,6 @@ ssl_connect(int s, short event, void *arg)
return;
}
- retry_flag = ssl_err = 0;
-
ret = SSL_connect(cte->ssl);
if (ret <= 0) {
ssl_err = SSL_get_error(cte->ssl, ret);
@@ -230,8 +225,8 @@ ssl_cleanup(struct ctl_tcp_event *cte)
void
ssl_error(const char *where, const char *what)
{
- unsigned long code;
char errbuf[128];
+ unsigned long code;
extern int debug;
if (!debug)