summaryrefslogtreecommitdiff
path: root/libfdcore/queues.c
diff options
context:
space:
mode:
authorSukchan Lee <acetcom@gmail.com>2021-03-21 13:14:26 +0900
committerSukchan Lee <acetcom@gmail.com>2021-03-21 13:14:26 +0900
commit32d46d3f43485e171b1e28117d0db049dfc829b0 (patch)
treeb3506d614932f50730e023391600287676ac0c08 /libfdcore/queues.c
parente07f3955e6d0f59f272fd21d3b21a5e2eac17426 (diff)
Release freeDiameter v1.5.0main
Diffstat (limited to 'libfdcore/queues.c')
-rw-r--r--libfdcore/queues.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/libfdcore/queues.c b/libfdcore/queues.c
index b317d34..561eaec 100644
--- a/libfdcore/queues.c
+++ b/libfdcore/queues.c
@@ -2,7 +2,7 @@
* Software License Agreement (BSD License) *
* Author: Sebastien Decugis <sdecugis@freediameter.net> *
* *
-* Copyright (c) 2013, WIDE Project and NICT *
+* Copyright (c) 2019, WIDE Project and NICT *
* All rights reserved. *
* *
* Redistribution and use of this software in source and binary forms, with or without modification, are *
@@ -44,9 +44,19 @@ struct fifo * fd_g_local = NULL;
int fd_queues_init(void)
{
TRACE_ENTRY();
- CHECK_FCT( fd_fifo_new ( &fd_g_incoming, 20 ) );
- CHECK_FCT( fd_fifo_new ( &fd_g_outgoing, 30 ) );
- CHECK_FCT( fd_fifo_new ( &fd_g_local, 25 ) );
+ CHECK_FCT( fd_fifo_new ( &fd_g_incoming, fd_g_config->cnf_qin_limit ) );
+ CHECK_FCT( fd_fifo_new ( &fd_g_outgoing, fd_g_config->cnf_qout_limit ) );
+ CHECK_FCT( fd_fifo_new ( &fd_g_local, fd_g_config->cnf_qlocal_limit ) );
+ return 0;
+}
+
+/* Resize according to values given in configuration file */
+int fd_queues_init_after_conf(void)
+{
+ TRACE_ENTRY();
+ CHECK_FCT( fd_fifo_set_max ( fd_g_incoming, fd_g_config->cnf_qin_limit ) );
+ CHECK_FCT( fd_fifo_set_max ( fd_g_outgoing, fd_g_config->cnf_qout_limit ) );
+ CHECK_FCT( fd_fifo_set_max ( fd_g_local, fd_g_config->cnf_qlocal_limit ) );
return 0;
}