summaryrefslogtreecommitdiff
path: root/accel-pppd/extra/connlimit.c
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-11-22 08:56:40 +0300
committerDmitry Kozlov <xeb@mail.ru>2014-11-22 08:56:40 +0300
commit81ca3923a29ea9b67f7291be23b210019546aa5f (patch)
treefcebf0d426665b4f06e01168f27cd8f9ab8c50d8 /accel-pppd/extra/connlimit.c
parent830c399cf126f6bf1e8dfa1ad919a3ce8e346c5d (diff)
downloadaccel-ppp-81ca3923a29ea9b67f7291be23b210019546aa5f.tar.gz
accel-ppp-81ca3923a29ea9b67f7291be23b210019546aa5f.zip
remove trailing whitespaces
Diffstat (limited to 'accel-pppd/extra/connlimit.c')
-rw-r--r--accel-pppd/extra/connlimit.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/accel-pppd/extra/connlimit.c b/accel-pppd/extra/connlimit.c
index fd7c952..49871dd 100644
--- a/accel-pppd/extra/connlimit.c
+++ b/accel-pppd/extra/connlimit.c
@@ -35,7 +35,7 @@ int __export connlimit_check(uint64_t key)
LIST_HEAD(tmp_list);
int r = 1;
-
+
clock_gettime(CLOCK_MONOTONIC, &ts);
pthread_mutex_lock(&lock);
@@ -87,13 +87,13 @@ int __export connlimit_check(uint64_t key)
r = 0;
}
-
+
if (r == 0)
log_debug("connlimit: accept %" PRIu64 "\n", key);
else
log_debug("connlimit: drop %" PRIu64 "\n", key);
-
+
while (!list_empty(&tmp_list)) {
it = list_entry(tmp_list.next, typeof(*it), entry);
list_del(&it->entry);
@@ -113,10 +113,10 @@ static int parse_limit(const char *opt, int *limit, int *time)
*time = 1;
return 0;
}
-
+
if (*endptr != '/')
goto out_err;
-
+
opt = endptr + 1;
*time = strtol(opt, &endptr, 10);
@@ -125,18 +125,18 @@ static int parse_limit(const char *opt, int *limit, int *time)
if (*endptr == 's')
return 0;
-
+
if (*endptr == 'm') {
*time *= 60;
return 0;
}
-
+
if (*endptr == 'h') {
*time *= 3600;
return 0;
}
-
-out_err:
+
+out_err:
log_error("connlimit: failed to parse '%s'\n", opt);
return -1;
}
@@ -156,7 +156,7 @@ static void load_config()
opt = conf_get_opt("connlimit", "burst");
if (opt)
conf_burst = atoi(opt);
-
+
opt = conf_get_opt("connlimit", "timeout");
if (opt)
conf_burst_timeout = atoi(opt) * 1000;