Commit 794ba613 authored by Linshizhi's avatar Linshizhi

add eof to mmproto

parent ed9a740b
...@@ -120,6 +120,7 @@ void mmpPush(MMProto *mm, uint8_t *packets, int size) { ...@@ -120,6 +120,7 @@ void mmpPush(MMProto *mm, uint8_t *packets, int size) {
info->size = size; info->size = size;
listPush(mm->buffer, info); listPush(mm->buffer, info);
mm->eof = true;
mm->size += size; mm->size += size;
} }
......
...@@ -22,6 +22,7 @@ typedef struct MMProto { ...@@ -22,6 +22,7 @@ typedef struct MMProto {
List *buffer; List *buffer;
MemMovContext context; MemMovContext context;
int size; int size;
_Bool eof;
} MMProto; } MMProto;
...@@ -38,6 +39,7 @@ typedef struct MMProto { ...@@ -38,6 +39,7 @@ typedef struct MMProto {
#define mmcRemain(MMC) ((MMC)->remain) #define mmcRemain(MMC) ((MMC)->remain)
#define mmcSetRemain(MMC, REMAIN) ((MMC)->remain = (REMAIN)) #define mmcSetRemain(MMC, REMAIN) ((MMC)->remain = (REMAIN))
#define mmpEmpty(MM) (listSize((MM)->buffer) == 0) #define mmpEmpty(MM) (listSize((MM)->buffer) == 0)
#define mmpIsEOF(MM) ((MM)->eof)
/* Prototypes */ /* Prototypes */
MMProto* createMMProto(void); MMProto* createMMProto(void);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment