Index: trunk/willow/src/willow/wnet.cc |
— | — | @@ -70,6 +70,7 @@ |
71 | 71 | static void wnet_sendfile_do(struct fde *); |
72 | 72 | |
73 | 73 | static void readbuf_reset(struct readbuf *); |
| 74 | +static void secondly_sched(void); |
74 | 75 | |
75 | 76 | struct fde *fde_table; |
76 | 77 | int max_fd; |
— | — | @@ -84,6 +85,26 @@ |
85 | 86 | awaks.push_back(s); |
86 | 87 | } |
87 | 88 | |
| 89 | +event secondly_ev; |
| 90 | +timeval secondly_tv; |
| 91 | + |
| 92 | +static void |
| 93 | +secondly_update(int, short, void *) |
| 94 | +{ |
| 95 | + wnet_set_time(); |
| 96 | + secondly_sched(); |
| 97 | +} |
| 98 | + |
| 99 | +static void |
| 100 | +secondly_sched(void) |
| 101 | +{ |
| 102 | + secondly_tv.tv_usec = 0; |
| 103 | + secondly_tv.tv_sec = 1; |
| 104 | + evtimer_set(&secondly_ev, secondly_update, NULL); |
| 105 | + event_base_set(evb, &secondly_ev); |
| 106 | + event_add(&secondly_ev, &secondly_tv); |
| 107 | +} |
| 108 | + |
88 | 109 | void |
89 | 110 | wnet_init(void) |
90 | 111 | { |
— | — | @@ -119,6 +140,7 @@ |
120 | 141 | } |
121 | 142 | wlog(WLOG_NOTICE, "wnet: initialised, using libevent %s (%s)", |
122 | 143 | event_get_version(), event_get_method()); |
| 144 | + secondly_sched(); |
123 | 145 | } |
124 | 146 | |
125 | 147 | void |