client: return early in client_new()
This saves one level of indent.
This commit is contained in:
parent
c0197c58ba
commit
d15e1e09a2
@ -237,6 +237,7 @@ static void client_close(struct client *client)
|
||||
void client_new(int fd, const struct sockaddr *addr)
|
||||
{
|
||||
unsigned int i;
|
||||
const char *hostname;
|
||||
|
||||
for (i = 0; i < client_max_connections
|
||||
&& clients[i].fd >= 0; i++) /* nothing */ ;
|
||||
@ -244,8 +245,9 @@ void client_new(int fd, const struct sockaddr *addr)
|
||||
if (i == client_max_connections) {
|
||||
ERROR("Max Connections Reached!\n");
|
||||
xclose(fd);
|
||||
} else {
|
||||
const char *hostname;
|
||||
return;
|
||||
}
|
||||
|
||||
switch (addr->sa_family) {
|
||||
#ifdef HAVE_TCP
|
||||
case AF_INET:
|
||||
@ -282,7 +284,6 @@ void client_new(int fd, const struct sockaddr *addr)
|
||||
SECURE("client %i: opened from %s\n", i, hostname);
|
||||
client_init(&(clients[i]), fd);
|
||||
}
|
||||
}
|
||||
|
||||
static int client_process_line(struct client *client)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user