Free (GPLv2) TCP/IP stack developed by TASS Belgium
Fork of PicoTCP by
Diff: include/pico_queue.h
- Revision:
- 24:8bff2b51ea3b
- Parent:
- 12:0c6fa180a6ec
- Child:
- 25:d63125298eb3
--- a/include/pico_queue.h Mon Jun 10 08:01:01 2013 +0000 +++ b/include/pico_queue.h Tue Jun 11 21:10:23 2013 +0000 @@ -9,6 +9,8 @@ #include "pico_config.h" #include "pico_frame.h" +#define Q_LIMIT 2048 + #ifndef NULL #define NULL ((void *)0) #endif @@ -60,7 +62,10 @@ { if ((q->max_frames) && (q->max_frames <= q->frames)) return -1; - + + if ((Q_LIMIT) && (Q_LIMIT < p->buffer_len + q->size)) + return -1; + if ((q->max_size) && (q->max_size < (p->buffer_len + q->size))) return -1;