summaryrefslogtreecommitdiff
path: root/client.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-01-04 01:15:08 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-01-04 01:15:08 +0100
commit6384dde85bb0729137c4de3c1c994edc5d7c8091 (patch)
tree85f16a5917da8866e2099fbea321ed6a503568b8 /client.c
parent5ee20abc0dea6e4187e212b1d8e9484f5e79f538 (diff)
fix resuming accept() calls after exceeding client limit
Diffstat (limited to 'client.c')
-rw-r--r--client.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/client.c b/client.c
index 7920102..dd3f912 100644
--- a/client.c
+++ b/client.c
@@ -438,7 +438,7 @@ static void set_addr(struct uh_addr *addr, void *src)
}
}
-void uh_accept_client(int fd)
+bool uh_accept_client(int fd)
{
static struct client *next_client;
struct client *cl;
@@ -455,7 +455,7 @@ void uh_accept_client(int fd)
sl = sizeof(addr);
sfd = accept(fd, (struct sockaddr *) &addr, &sl);
if (sfd < 0)
- return;
+ return false;
set_addr(&cl->peer_addr, &addr);
sl = sizeof(addr);
@@ -476,6 +476,7 @@ void uh_accept_client(int fd)
next_client = NULL;
n_clients++;
cl->id = client_id++;
+ return true;
}
void uh_close_fds(void)