From 4ce8d9c0203d6360ac19f04ae3c33619058229c8 Mon Sep 17 00:00:00 2001 From: John Ferlito Date: Sat, 13 Sep 2014 11:15:30 +1000 Subject: [PATCH] Move sockent_client_disconnect above sockent_client_disconnect so we can use it there --- src/network.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/src/network.c b/src/network.c index 0e1ff512..9ad4dead 100644 --- a/src/network.c +++ b/src/network.c @@ -2097,6 +2097,26 @@ static int sockent_init_crypto (sockent_t *se) /* {{{ */ return (0); } /* }}} int sockent_init_crypto */ +static int sockent_client_disconnect (sockent_t *se) /* {{{ */ +{ + struct sockent_client *client; + + if ((se == NULL) || (se->type != SOCKENT_TYPE_CLIENT)) + return (EINVAL); + + client = &se->data.client; + if (client->fd >= 0) /* connected */ + { + close (client->fd); + client->fd = -1; + } + + sfree (client->addr); + client->addrlen = 0; + + return (0); +} /* }}} int sockent_client_disconnect */ + static int sockent_client_connect (sockent_t *se) /* {{{ */ { static c_complain_t complaint = C_COMPLAIN_INIT_STATIC; @@ -2182,26 +2202,6 @@ static int sockent_client_connect (sockent_t *se) /* {{{ */ return (0); } /* }}} int sockent_client_connect */ -static int sockent_client_disconnect (sockent_t *se) /* {{{ */ -{ - struct sockent_client *client; - - if ((se == NULL) || (se->type != SOCKENT_TYPE_CLIENT)) - return (EINVAL); - - client = &se->data.client; - if (client->fd >= 0) /* connected */ - { - close (client->fd); - client->fd = -1; - } - - sfree (client->addr); - client->addrlen = 0; - - return (0); -} /* }}} int sockent_client_disconnect */ - /* Open the file descriptors for a initialized sockent structure. */ static int sockent_server_listen (sockent_t *se) /* {{{ */ { -- 2.30.2