FileData: add stream_offset field

This is required to store the offset for reassembling chunks.
pull/1473/head
Giuseppe Longo 11 years ago committed by Victor Julien
parent 68cf3dd621
commit b9468aba7c

@ -492,6 +492,11 @@ int FileAppendData(FileContainer *ffc, uint8_t *data, uint32_t data_len)
SCReturnInt(-1);
}
if (ffc->tail->chunks_head == NULL)
ffd->stream_offset = 0;
else
ffd->stream_offset = ffc->tail->size;
/* append the data */
if (FileAppendFileData(ffc, ffd) < 0) {
ffc->tail->state = FILE_STATE_ERROR;

@ -53,6 +53,7 @@ typedef enum FileState_ {
typedef struct FileData_ {
uint8_t *data;
uint32_t len;
uint64_t stream_offset;
int stored; /* true if this chunk has been stored already
* false otherwise */
struct FileData_ *next;

Loading…
Cancel
Save