+ /* check the heaps to see if there's still stuff in there, and
+ * only set the timer if there are packets to process
+ */
+ timer_enabled = 0;
+ for (i=0; i < 3 ; i++) {
+ h = heaps[i];
+ if (h->elements > 0) { // set the timer
+ ts.tv_sec = 0;
+ ts.tv_nsec = 1 * 1000000; // 1ms
+ timer_enabled = 1;
+ bsd_timeout(dummynet, NULL, &ts);
+ break;
+ }
+ }