|
|
|
@ -630,9 +630,10 @@ static int FileAppendDataDo(File *ff, const uint8_t *data, uint32_t data_len)
|
|
|
|
|
|
|
|
|
|
SCLogDebug("appending %"PRIu32" bytes", data_len);
|
|
|
|
|
|
|
|
|
|
if (AppendData(ff, data, data_len) != 0) {
|
|
|
|
|
int r = AppendData(ff, data, data_len);
|
|
|
|
|
if (r != 0) {
|
|
|
|
|
ff->state = FILE_STATE_ERROR;
|
|
|
|
|
SCReturnInt(-1);
|
|
|
|
|
SCReturnInt(r);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SCReturnInt(0);
|
|
|
|
@ -943,6 +944,7 @@ int FileCloseFile(FileContainer *ffc, const uint8_t *data,
|
|
|
|
|
|
|
|
|
|
SCReturnInt(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int FileCloseFileById(FileContainer *ffc, uint32_t track_id,
|
|
|
|
|
const uint8_t *data, uint32_t data_len, uint16_t flags)
|
|
|
|
|
{
|
|
|
|
@ -955,10 +957,8 @@ int FileCloseFileById(FileContainer *ffc, uint32_t track_id,
|
|
|
|
|
File *ff = ffc->head;
|
|
|
|
|
for ( ; ff != NULL; ff = ff->next) {
|
|
|
|
|
if (track_id == ff->file_track_id) {
|
|
|
|
|
if (FileCloseFilePtr(ff, data, data_len, flags) == -1) {
|
|
|
|
|
SCReturnInt(-1);
|
|
|
|
|
}
|
|
|
|
|
SCReturnInt(0);
|
|
|
|
|
int r = FileCloseFilePtr(ff, data, data_len, flags);
|
|
|
|
|
SCReturnInt(r);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
SCReturnInt(-1);
|
|
|
|
|