summaryrefslogtreecommitdiffstats
path: root/plugins/omelasticsearch/omelasticsearch.c
diff options
context:
space:
mode:
authorAndre Lorbach <alorbach@adiscon.com>2013-07-23 12:33:33 +0200
committerAndre Lorbach <alorbach@adiscon.com>2013-07-23 12:33:33 +0200
commit18fc42beaf7419c4a134a4171352ebb0b151d425 (patch)
treed15b61e671c2f5f92f4ae0bfa52c9236cb6403bb /plugins/omelasticsearch/omelasticsearch.c
parentd7ca5b2b1581b04cdc9b68a97865e8e98eee4f74 (diff)
downloadrsyslog-18fc42beaf7419c4a134a4171352ebb0b151d425.tar.gz
rsyslog-18fc42beaf7419c4a134a4171352ebb0b151d425.tar.bz2
rsyslog-18fc42beaf7419c4a134a4171352ebb0b151d425.zip
Fixed bugid #464 in elasticsearch output module
Added some libcurl options in checkConn to disable the bodyport of the request within this functions. Otherwise libcurl could have created a sigsegv when curl_easy_perform() was called.
Diffstat (limited to 'plugins/omelasticsearch/omelasticsearch.c')
-rw-r--r--plugins/omelasticsearch/omelasticsearch.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/omelasticsearch/omelasticsearch.c b/plugins/omelasticsearch/omelasticsearch.c
index cb96fb6b..5c53ba19 100644
--- a/plugins/omelasticsearch/omelasticsearch.c
+++ b/plugins/omelasticsearch/omelasticsearch.c
@@ -224,6 +224,12 @@ checkConn(instanceData *pData)
DBGPRINTF("omelasticsearch: checkConn() curl_easy_init() failed\n");
ABORT_FINALIZE(RS_RET_SUSPENDED);
}
+ /* Bodypart of request not needed, so set curl opt to nobody and httpget, otherwise lib-curl could sigsegv */
+ curl_easy_setopt(curl, CURLOPT_HTTPGET, TRUE);
+ curl_easy_setopt(curl, CURLOPT_NOBODY, TRUE);
+ /* Only enable for debugging
+ curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE); */
+
cstr = es_str2cstr(url, NULL);
curl_easy_setopt(curl, CURLOPT_URL, cstr);
free(cstr);