summaryrefslogtreecommitdiff
path: root/libfdcore/queues.c
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2024-08-08 14:34:10 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2024-08-08 14:34:10 -0300
commit56f96f0bdc6187ce19064d311c000656ae68008b (patch)
tree104a7843861befbd4da34a66f03b85d7b9ea0df9 /libfdcore/queues.c
parent3e8d3ed13f58af810934de696c34bf5bf16ddcc6 (diff)
New upstream version 1.5.0upstream
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;
}