telev: add send queue limit

This commit is contained in:
Alfred E. Heggestad 2016-02-01 12:52:56 +00:00
parent bfa2112207
commit a9ba99ae3e

View file

@ -49,6 +49,7 @@ enum {
EVENT_END = 0xff,
PAYLOAD_SIZE = 4,
VOLUME = 10,
QUEUE_SIZE = 8192,
};
@ -192,6 +193,9 @@ int telev_send(struct telev *tel, int event, bool end)
if (!tel)
return EINVAL;
if (tel->mb->end >= QUEUE_SIZE)
return EOVERFLOW;
pos = tel->mb->pos;
tel->mb->pos = tel->mb->end;