Small updates and a little standardization for config.h.in naming.

This commit is contained in:
Seth Hall 2012-06-17 22:55:11 -04:00
parent 57980c86e6
commit cb7eac212e
7 changed files with 32 additions and 18 deletions

View file

@ -17,7 +17,7 @@
#include "writers/Ascii.h"
#include "writers/None.h"
#ifdef INSTALL_ELASTICSEARCH
#ifdef USE_ELASTICSEARCH
#include "writers/ElasticSearch.h"
#endif
@ -40,7 +40,7 @@ WriterDefinition log_writers[] = {
{ BifEnum::Log::WRITER_NONE, "None", 0, writer::None::Instantiate },
{ BifEnum::Log::WRITER_ASCII, "Ascii", 0, writer::Ascii::Instantiate },
#ifdef INSTALL_ELASTICSEARCH
#ifdef USE_ELASTICSEARCH
{ BifEnum::Log::WRITER_ELASTICSEARCH, "ElasticSearch", 0, writer::ElasticSearch::Instantiate },
#endif

View file

@ -2,7 +2,7 @@
#include "config.h"
#ifdef INSTALL_ELASTICSEARCH
#ifdef USE_ELASTICSEARCH
#include <string>
#include <errno.h>
@ -261,7 +261,7 @@ CURL* ElasticSearch::HTTPSetup()
// HTTP 1.1 likes to use chunked encoded transfers, which aren't good for speed. The best (only?) way to disable that is to
// just use HTTP 1.0
curl_easy_setopt(handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
//curl_easy_setopt(handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
return handle;
}
@ -275,8 +275,8 @@ bool ElasticSearch::HTTPSend()
{
CURLcode return_code;
curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDSIZE_LARGE, buffer.Len());
curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDS, buffer.Bytes());
curl_easy_setopt(curl_handle, CURLOPT_POSTFIELDSIZE, buffer.Len());
return_code = curl_easy_perform(curl_handle);
switch ( return_code )

View file

@ -12,6 +12,10 @@
#include <getopt.h>
#endif
#ifdef USE_CURL
#include <curl/curl.h>
#endif
#ifdef USE_IDMEF
extern "C" {
#include <libidmef/idmefxml.h>
@ -716,6 +720,10 @@ int main(int argc, char** argv)
SSL_library_init();
SSL_load_error_strings();
#ifdef USE_CURL
curl_global_init(CURL_GLOBAL_ALL);
#endif
// FIXME: On systems that don't provide /dev/urandom, OpenSSL doesn't
// seed the PRNG. We should do this here (but at least Linux, FreeBSD
// and Solaris provide /dev/urandom).
@ -1066,6 +1074,10 @@ int main(int argc, char** argv)
done_with_network();
net_delete();
#ifdef USE_CURL
curl_global_cleanup();
#endif
terminate_bro();
// Close files after net_delete(), because net_delete()