Changeset 253:ad6c0118fb50 in freeDiameter
- Timestamp:
- Apr 13, 2010, 2:50:54 PM (14 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/freediameter.conf.sample
r24 r253 144 144 # Default: Relaying is enabled. 145 145 #NoRelay; 146 147 # Number of server threads that can handle incoming messages at the same time. 148 # TODO: implement dynamic # of threads depending on the length of the queue. 149 # Default: 4 150 #AppServThreads = 4; 146 151 147 152 # Other applications are configured by loading appropriate extensions. -
freeDiameter/config.c
r189 r253 59 59 fd_g_config->cnf_port_tls = 3869; 60 60 fd_g_config->cnf_sctp_str = 30; 61 fd_g_config->cnf_dispthr = 4; 61 62 fd_list_init(&fd_g_config->cnf_endpoints, NULL); 62 63 fd_list_init(&fd_g_config->cnf_apps, NULL); … … 92 93 fd_log_debug(" Local secure port ...... : %hu\n", fd_g_config->cnf_port_tls); 93 94 fd_log_debug(" Number of SCTP streams . : %hu\n", fd_g_config->cnf_sctp_str); 95 fd_log_debug(" Number of server threads : %hu\n", fd_g_config->cnf_dispthr); 94 96 if (FD_IS_LIST_EMPTY(&fd_g_config->cnf_endpoints)) { 95 97 fd_log_debug(" Local endpoints ........ : Default (use all available)\n"); -
freeDiameter/fdd.l
r18 r253 123 123 (?i:"TLS_old_method") { return OLDTLS; } 124 124 (?i:"SCTP_streams") { return SCTPSTREAMS; } 125 (?i:"AppServThreads") { return APPSERVTHREADS;} 125 126 (?i:"ListenOn") { return LISTENON; } 126 127 (?i:"TcTimer") { return TCTIMER; } -
freeDiameter/fdd.y
r142 r253 105 105 %token NOTLS 106 106 %token SCTPSTREAMS 107 %token APPSERVTHREADS 107 108 %token LISTENON 108 109 %token TCTIMER … … 133 134 | conffile listenon 134 135 | conffile norelay 136 | conffile appservthreads 135 137 | conffile noip 136 138 | conffile noip6 … … 231 233 ; 232 234 235 appservthreads: APPSERVTHREADS '=' INTEGER ';' 236 { 237 CHECK_PARAMS_DO( ($3 > 0) && ($3 < 1024), 238 { yyerror (&yylloc, conf, "Invalid value"); YYERROR; } ); 239 conf->cnf_dispthr = (uint16_t)$3; 240 } 241 ; 242 233 243 noip: NOIP ';' 234 244 { -
freeDiameter/main.c
r236 r253 96 96 CHECK_FCT( fd_msg_init() ); 97 97 CHECK_FCT( fd_p_expi_init() ); 98 CHECK_FCT( fd_rtdisp_init() );99 98 100 99 /* Parse the configuration file */ 101 100 CHECK_FCT( fd_conf_parse() ); 101 102 /* Create the daemon's threads */ 103 CHECK_FCT( fd_rtdisp_init() ); 102 104 103 105 /* Load the dynamic extensions */ -
freeDiameter/routing_dispatch.c
r241 r253 1070 1070 /********************************************************************************/ 1071 1071 1072 static pthread_t * dispatch = NULL; 1073 static enum thread_state * disp_state = NULL; 1074 1072 1075 /* Later: make this more dynamic */ 1073 static pthread_t dispatch = (pthread_t)NULL;1074 static enum thread_state disp_state = INITIAL;1075 1076 1076 static pthread_t rt_out = (pthread_t)NULL; 1077 1077 static enum thread_state out_state = INITIAL; … … 1083 1083 int fd_rtdisp_init(void) 1084 1084 { 1085 CHECK_POSIX( pthread_create( &dispatch, NULL, dispatch_thr, &disp_state ) ); 1085 int i; 1086 1087 /* Prepare the array for dispatch */ 1088 CHECK_MALLOC( dispatch = calloc(fd_g_config->cnf_dispthr, sizeof(pthread_t)) ); 1089 CHECK_MALLOC( disp_state = calloc(fd_g_config->cnf_dispthr, sizeof(enum thread_state)) ); 1090 1091 /* Create the threads */ 1092 for (i=0; i < fd_g_config->cnf_dispthr; i++) { 1093 CHECK_POSIX( pthread_create( &dispatch[i], NULL, dispatch_thr, &disp_state[i] ) ); 1094 } 1086 1095 CHECK_POSIX( pthread_create( &rt_out, NULL, routing_out_thr, &out_state) ); 1087 1096 CHECK_POSIX( pthread_create( &rt_in, NULL, routing_in_thr, &in_state) ); … … 1139 1148 int fd_rtdisp_fini(void) 1140 1149 { 1150 int i; 1151 1141 1152 /* Destroy the incoming queue */ 1142 1153 CHECK_FCT_DO( fd_queues_fini(&fd_g_incoming), /* ignore */); … … 1155 1166 1156 1167 /* Stop the Dispatch thread */ 1157 stop_thread_delayed(&disp_state, &dispatch, "Dispatching"); 1168 for (i=0; i < fd_g_config->cnf_dispthr; i++) { 1169 stop_thread_delayed(&disp_state[i], &dispatch[i], "Dispatching"); 1170 } 1158 1171 1159 1172 return 0; -
include/freeDiameter/freeDiameter.h
r214 r253 91 91 struct fd_list cnf_endpoints; /* the local endpoints to bind the server to. list of struct fd_endpoint. default is empty (bind all) */ 92 92 struct fd_list cnf_apps; /* Applications locally supported (except relay, see flags). Use fd_disp_app_support to add one. list of struct fd_app. */ 93 uint16_t cnf_dispthr; /* Number of dispatch threads to create */ 93 94 struct { 94 95 unsigned no_fwd : 1; /* the peer does not relay messages (0xffffff app id) */
Note: See TracChangeset
for help on using the changeset viewer.