telev: add send queue limit
This commit is contained in:
parent
bfa2112207
commit
a9ba99ae3e
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue