summaryrefslogtreecommitdiffstats
path: root/cacheserver/utmpserver3.c
diff options
context:
space:
mode:
authorwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-08-31 15:20:03 +0800
committerwens <wens@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2006-08-31 15:20:03 +0800
commit29bf757e991e31f9de947848417b79f59f1eef35 (patch)
tree0ed91980f57d97f1e0c88e452680c49b0044adb9 /cacheserver/utmpserver3.c
parenta80ffc6edfdad66943495839f7f20ebe43e4cf09 (diff)
downloadpttbbs-29bf757e991e31f9de947848417b79f59f1eef35.tar
pttbbs-29bf757e991e31f9de947848417b79f59f1eef35.tar.gz
pttbbs-29bf757e991e31f9de947848417b79f59f1eef35.tar.bz2
pttbbs-29bf757e991e31f9de947848417b79f59f1eef35.tar.lz
pttbbs-29bf757e991e31f9de947848417b79f59f1eef35.tar.xz
pttbbs-29bf757e991e31f9de947848417b79f59f1eef35.tar.zst
pttbbs-29bf757e991e31f9de947848417b79f59f1eef35.zip
fix bug.
git-svn-id: http://opensvn.csie.org/pttbbs/trunk/pttbbs@3406 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'cacheserver/utmpserver3.c')
-rw-r--r--cacheserver/utmpserver3.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/cacheserver/utmpserver3.c b/cacheserver/utmpserver3.c
index 9b1ef7ac..1d9f4ea5 100644
--- a/cacheserver/utmpserver3.c
+++ b/cacheserver/utmpserver3.c
@@ -186,6 +186,7 @@ struct event ev;
int clients = 0;
#define READ_BLOCK 1024
+#define MAX_CLIENTS 10
void connection_client(int cfd, short event, void *arg)
{
@@ -228,6 +229,7 @@ void connection_client(int cfd, short event, void *arg)
break;
case FSM_SYNC:
syncutmp(cfd);
+ firstsync = 1;
cs->state = FSM_EXIT;
break;
case FSM_LOGIN:
@@ -260,7 +262,7 @@ void connection_client(int cfd, short event, void *arg)
cs->state = FSM_EXIT;
break;
case FSM_EXIT:
- if (clients == 10)
+ if (clients == MAX_CLIENTS)
event_add(&ev, NULL);
close(cfd);
evbuffer_free(cs->evb);
@@ -281,7 +283,7 @@ void connection_accept(int fd, short event, void *arg)
socklen_t len = sizeof(clientaddr);
int cfd;
- if (clients > 10) {
+ if (clients > MAX_CLIENTS) {
event_del(&ev);
return;
}