Browse Source

Flush request queue to prevent collecting too much data.

Since it is possible for EMMs and ECMs to be removed from
the queues when hard limits are reached, it is a good idea
to clear the request queue too. Without this when queues
reach their hard limits, request queue will grow slowly eating
a bit of memory. It is not much but it is wasted memory.
Georgi Chorbadzhiyski 11 years ago
parent
commit
597741511b
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      camd.c

+ 5
- 0
camd.c View File

@@ -246,6 +246,11 @@ static void *camd_thread(void *in_ts) {
246 246
 				camd_msg_free(&msg);
247 247
 			}
248 248
 		}
249
+
250
+		// Flush request queue
251
+		while(ts->camd.req_queue->items > ts->camd.emm_queue->items + ts->camd.ecm_queue->items) {
252
+			queue_get_nowait(ts->camd.req_queue);
253
+		}
249 254
 	}
250 255
 	// Flush ECM queue
251 256
 	while (ts->camd.ecm_queue->items) {

Loading…
Cancel
Save