[Nbd] [PATCH 2/5] ndb-server: rename handle_connection() -> handle_oldstyle_connection()
- To: nbd-general@lists.sourceforge.net
- Subject: [Nbd] [PATCH 2/5] ndb-server: rename handle_connection() -> handle_oldstyle_connection()
- From: Tuomas Räsänen <tuomasjjrasanen@...1261...>
- Date: Wed, 5 Jun 2013 20:42:42 +0300
- Message-id: <bc70691324b96f5395723283cfc9503b7bdd1e7b.1370452657.git.tuomasjjrasanen@...1261...>
- In-reply-to: <60658c7c00129387875f3fdaf08441b89fa4ad8c.1370452657.git.tuomasjjrasanen@...1261...>
- References: <60658c7c00129387875f3fdaf08441b89fa4ad8c.1370452657.git.tuomasjjrasanen@...1261...>
The new name describes better the actual usage.
Remove also the fourth parameter, CLIENT*, which was always NULL.
Signed-off-by: Tuomas Räsänen <tuomasjjrasanen@...1261...>
---
nbd-server.c | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/nbd-server.c b/nbd-server.c
index 6523051..ac5b8b7 100644
--- a/nbd-server.c
+++ b/nbd-server.c
@@ -2354,8 +2354,9 @@ handler_err:
}
static void
-handle_connection(GArray *servers, int net, SERVER *serve, CLIENT *client)
+handle_oldstyle_connection(GArray *servers, int net, SERVER *serve)
{
+ CLIENT *client = NULL;
int sock_flags_old;
int sock_flags_new;
@@ -2372,13 +2373,13 @@ handle_connection(GArray *servers, int net, SERVER *serve, CLIENT *client)
fcntl(net, F_SETFL, sock_flags_new) == -1) {
err("fcntl F_SETFL ~O_NONBLOCK");
}
- if(!client) {
- client = g_new0(CLIENT, 1);
- client->server=serve;
- client->exportsize=OFFT_MAX;
- client->net=net;
- client->transactionlogfd = -1;
- }
+
+ client = g_new0(CLIENT, 1);
+ client->server=serve;
+ client->exportsize=OFFT_MAX;
+ client->net=net;
+ client->transactionlogfd = -1;
+
if (set_peername(net, client)) {
goto handle_connection_out;
}
@@ -2603,7 +2604,7 @@ void serveloop(GArray* servers) {
err_nonfatal("accept: %m");
continue;
}
- handle_connection(servers, net, serve, NULL);
+ handle_oldstyle_connection(servers, net, serve);
}
}
}
--
1.7.10.4
Reply to: