From 7cf0a95908c815976aa908f34d238ae12d11c69d Mon Sep 17 00:00:00 2001 From: Max Lv Date: Fri, 21 Jun 2013 08:32:57 +0800 Subject: [PATCH] use rand instead --- src/local.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/local.c b/src/local.c index bb101c9b..faa9ae05 100644 --- a/src/local.c +++ b/src/local.c @@ -11,7 +11,6 @@ #include #include #include -#include #include #ifdef HAVE_CONFIG_H @@ -581,7 +580,7 @@ static void accept_cb (EV_P_ ev_io *w, int revents) { memset(&hints, 0, sizeof hints); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; - int index = clock() % listener->remote_num; + int index = rand() % listener->remote_num; if (verbose) { LOGD("connect to remote: %s", listener->remote_host[index]); }