Revision 8a7fb885 nest/proto.c

View differences:

nest/proto.c
586 586
  DBG("%s: Scheduling meal\n", p->name);
587 587
  p->core_state = FS_FEEDING;
588 588
  p->refeeding = !initial;
589

  
590
  /* Hack: reset exp_routes during refeed, and do not decrease it later */
591
  if (!initial)
592
    p->stats.exp_routes = 0;
593

  
589 594
  proto_relink(p);
590 595
  p->attn->hook = initial ? proto_feed_initial : proto_feed_more;
591 596
  ev_schedule(p->attn);
......
825 830
	cnt++;
826 831
	switch (xx)
827 832
	  {
828
	  case 0:
833
	  case XX_DISABLE:
829 834
	    if (p->disabled)
830 835
	      cli_msg(-8, "%s: already disabled", p->name);
831 836
	    else
......
835 840
		proto_rethink_goal(p);
836 841
	      }
837 842
	    break;
838
	  case 1:
843

  
844
	  case XX_ENABLE:
839 845
	    if (!p->disabled)
840 846
	      cli_msg(-10, "%s: already enabled", p->name);
841 847
	    else
......
845 851
		proto_rethink_goal(p);
846 852
	      }
847 853
	    break;
848
	  case 2:
854

  
855
	  case XX_RESTART:
849 856
	    if (p->disabled)
850 857
	      cli_msg(-8, "%s: already disabled", p->name);
851 858
	    else
......
857 864
		cli_msg(-12, "%s: restarted", p->name);
858 865
	      }
859 866
	    break;
860
	  case 3:
861
	    // FIXME change msg number
862
	    if (p->disabled)
863
	      cli_msg(-8, "%s: already disabled", p->name);
864
	    else if (p->reload_routes && p->reload_routes(p))
865
	      cli_msg(-12, "%s: reloading", p->name);
866
	    else
867
	      cli_msg(-12, "%s: reload failed", p->name);
868
	    break;
869
	  case 4:
870
	    // FIXME change msg number
867

  
868
	  case XX_RELOAD:
869
	  case XX_RELOAD_IN:
870
	  case XX_RELOAD_OUT:
871 871
	    if (p->disabled)
872
	      cli_msg(-8, "%s: already disabled", p->name);
873
	    else
874 872
	      {
875
		proto_request_feeding(p);
876
		cli_msg(-12, "%s: reexport failed", p->name);
873
		cli_msg(-8, "%s: already disabled", p->name);
874
		break;
877 875
	      }
876

  
877
	    /* re-importing routes */
878
	    if (xx != XX_RELOAD_OUT)
879
	      if (! (p->reload_routes && p->reload_routes(p)))
880
		{
881
		  cli_msg(-8006, "%s: reload failed", p->name);
882
		  break;
883
		}
884
		 
885
	    /* re-exporting routes */
886
	    if (xx != XX_RELOAD_IN)
887
	      proto_request_feeding(p);
888

  
889
	    cli_msg(-15, "%s: reloading", p->name);
878 890
	    break;
879 891

  
880 892
	  default:

Also available in: Unified diff