projects
/
srvx.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix possible crash on user deletion
[srvx.git]
/
src
/
policer.c
diff --git
a/src/policer.c
b/src/policer.c
index 62b9253fae5b0f15526cfc8d2cc997f54c06bd6f..21257ea153fc675d3a0a9b118934343dd261dfa4 100644
(file)
--- a/
src/policer.c
+++ b/
src/policer.c
@@
-1,11
+1,12
@@
/* policer.c - Leaky bucket
* Copyright 2000-2002 srvx Development Team
*
/* policer.c - Leaky bucket
* Copyright 2000-2002 srvx Development Team
*
- * This program is free software; you can redistribute it and/or modify
+ * This file is part of srvx.
+ *
+ * srvx is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version. Important limitations are
- * listed in the COPYING file that accompanies this software.
+ * (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@
-13,13
+14,14
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, email srvx-maintainers@srvx.net.
+ * along with srvx; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#include "common.h"
#include "policer.h"
*/
#include "common.h"
#include "policer.h"
-/* This policer uses the "leaky bucket" (GCRA) algorithm. */
+/* This policer uses the "leaky bucket" (GCRA) algorithm. */
struct policer_params {
double bucket_size;
struct policer_params {
double bucket_size;
@@
-39,11
+41,11
@@
int
policer_params_set(struct policer_params *params, const char *param, const char *value)
{
if (!irccasecmp(param, "size")) {
policer_params_set(struct policer_params *params, const char *param, const char *value)
{
if (!irccasecmp(param, "size")) {
- params->bucket_size = strtod(value, NULL);
+
params->bucket_size = strtod(value, NULL);
} else if (!irccasecmp(param, "drain-rate")) {
} else if (!irccasecmp(param, "drain-rate")) {
- params->drain_rate = strtod(value, NULL);
+
params->drain_rate = strtod(value, NULL);
} else {
} else {
- return 0;
+
return 0;
}
return 1;
}
}
return 1;
}