Ejemplo n.º 1
0
/* Process all the files in the file queue*/
static inline void file_agent_process_files(CircularBuffer *file_list,
        FileInspectConf* conf )
{
    while (!cbuffer_is_empty(file_list))
    {
        FileInfo *file;
        file = file_agent_get_file();

        if (file && file->sha256)
        {
            /* Save to disk */
            if (conf->capture_dir)
                file_agent_save_file(file, conf->capture_dir);
            /* Send to other host */
            if (conf->hostname)
                file_agent_send_file(file);
            /* Default, memory only */
        }

        file = file_agent_finish_file();

        if (file)
        {
            _dpd.fileAPI->release_file(file->file_mem);
            free(file);
        }
    }
}
Ejemplo n.º 2
0
/* Process all the files in the file queue*/
static inline void file_agent_process_files(CircularBuffer *file_list,
        FileInspectConf* conf )
{
    while (!cbuffer_is_empty(file_list))
    {
        FileInfo *file;
        file = file_agent_get_file();

        if (file && file->sha256)
        {
            /* Save to disk */
            if (conf->capture_dir)
                file_agent_save_file(file, conf->capture_dir);
            /* Send to other host */
            if (conf->hostname)
                file_agent_send_file(file);
#ifdef HAVE_S3FILE
            if (conf->kafka.rkt) {
                file_agent_send_kafka(conf->kafka.rkt,conf->kafka.partition,
                    file);
                rd_kafka_poll(conf->kafka.rk,0);
            }

            if (conf->s3.cluster) {
                file_agent_send_s3(&conf->s3,file);
            }

#endif
            /* Default, memory only */
        }

        file = file_agent_finish_file();

        if (file)
        {
            _dpd.fileAPI->release_file(file->file_mem);
            free(file);
        }
    }
}