[Olsr-cvs] olsrd-current/lib/nameservice/src nameservice.c, 1.30, 1.31

Bernd Petrovitsch (spam-protected)
Tue Sep 18 00:24:24 CEST 2007


Update of /cvsroot/olsrd/olsrd-current/lib/nameservice/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22219/lib/nameservice/src

Modified Files:
	nameservice.c 
Log Message:
* applied 114-olsrd-timeoutlimit.patch

Index: nameservice.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/nameservice/src/nameservice.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** nameservice.c	17 Sep 2007 21:57:05 -0000	1.30
--- nameservice.c	17 Sep 2007 22:24:22 -0000	1.31
***************
*** 380,384 ****
  	/* register functions with olsrd */
  	olsr_parser_add_function(&olsr_parser, PARSER_TYPE, 1);
! 	olsr_register_timeout_function(&olsr_timeout);
  	olsr_register_scheduler_event(&olsr_event, NULL, my_interval, 0, NULL);
  
--- 380,384 ----
  	/* register functions with olsrd */
  	olsr_parser_add_function(&olsr_parser, PARSER_TYPE, 1);
! 	olsr_register_timeout_function(&olsr_timeout, OLSR_TRUE);
  	olsr_register_scheduler_event(&olsr_event, NULL, my_interval, 0, NULL);
  
***************
*** 482,497 ****
   * and write changes to file
   */
  void
  olsr_timeout(void)
  {
! 	timeout_old_names(list, &name_table_changed);
! 	timeout_old_names(forwarder_list, &forwarder_table_changed);
! 	timeout_old_names(service_list, &service_table_changed);
! 	timeout_old_names(latlon_list, &latlon_table_changed);
! 
! 	write_resolv_file();
! 	write_hosts_file();
! 	write_services_file();
! 	write_latlon_file();
  }
  
--- 482,514 ----
   * and write changes to file
   */
+ 
+ static int timeout_roundrobin = 0;
+ 
  void
  olsr_timeout(void)
  {
! 	switch(timeout_roundrobin++)
! 	{
! 		case 0:
! 			timeout_old_names(list, &name_table_changed);
! 			timeout_old_names(forwarder_list, &forwarder_table_changed);
! 			timeout_old_names(service_list, &service_table_changed);
! 			timeout_old_names(latlon_list, &latlon_table_changed);
! 			break;
! 		case 1:
! 			write_resolv_file(); // if forwarder_table_changed
! 			break;
! 		case 2:
! 			write_hosts_file(); // if name_table_changed
! 			break;
! 		case 3:
! 			write_services_file(); // if service_table_changed
! 			break;
! 		case 4:
! 			write_latlon_file(); // latlon_table_changed
! 			break;
! 		default:
! 			timeout_roundrobin = 0;
! 	} // switch
  }
  





More information about the Olsr-cvs mailing list