Add a file descriptor to the flow file structure.

remotes/origin/master-1.2.x
Victor Julien 15 years ago
parent cd618e48df
commit 3c1edf3763

@ -177,6 +177,8 @@ static FlowFile *FlowFileAlloc(uint8_t *name, uint16_t name_len) {
}
memset(new, 0, sizeof(FlowFile));
new->fd = -1;
new->name = SCMalloc(name_len);
if (new->name == NULL) {
SCFree(new);
@ -193,6 +195,9 @@ static void FlowFileFree(FlowFile *ff) {
if (ff == NULL)
return;
if (ff->fd != -1)
close(ff->fd);
if (ff->name != NULL)
SCFree(ff->name);
SCFree(ff);

@ -53,7 +53,8 @@ typedef struct FlowFileData_ {
typedef struct FlowFile_ {
uint8_t *name;
uint16_t name_len;
FlowFileState state;
int16_t state;
int fd; /**< file discriptor for storing files */
FlowFileData *chunks_head;
FlowFileData *chunks_tail;
struct FlowFile_ *next;

Loading…
Cancel
Save