2 * collectd - src/write_http.c
3 * Copyright (C) 2009 Paul Sadauskas
4 * Copyright (C) 2009 Doug MacEachern
5 * Copyright (C) 2007-2014 Florian octo Forster
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; only version 2 of the License is applicable.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 * Florian octo Forster <octo at collectd.org>
22 * Doug MacEachern <dougm@hyperic.com>
23 * Paul Sadauskas <psadauskas@gmail.com>
30 #include "utils_format_json.h"
31 #include "utils_format_kairosdb.h"
33 #include <curl/curl.h>
35 #ifndef WRITE_HTTP_DEFAULT_BUFFER_SIZE
36 # define WRITE_HTTP_DEFAULT_BUFFER_SIZE 4096
61 time_t low_speed_time;
64 #define WH_FORMAT_COMMAND 0
65 #define WH_FORMAT_JSON 1
66 #define WH_FORMAT_KAIROSDB 2
69 _Bool send_notifications;
72 struct curl_slist *headers;
73 char curl_errbuf[CURL_ERROR_SIZE];
76 size_t send_buffer_size;
77 size_t send_buffer_free;
78 size_t send_buffer_fill;
79 cdtime_t send_buffer_init_time;
81 pthread_mutex_t send_lock;
83 typedef struct wh_callback_s wh_callback_t;
85 static void wh_log_http_error (wh_callback_t *cb)
87 if (!cb->log_http_error)
92 curl_easy_getinfo (cb->curl, CURLINFO_RESPONSE_CODE, &http_code);
95 INFO ("write_http plugin: HTTP Error code: %lu", http_code);
98 static void wh_reset_buffer (wh_callback_t *cb) /* {{{ */
100 if ((cb == NULL) || (cb->send_buffer == NULL))
103 memset (cb->send_buffer, 0, cb->send_buffer_size);
104 cb->send_buffer_free = cb->send_buffer_size;
105 cb->send_buffer_fill = 0;
106 cb->send_buffer_init_time = cdtime ();
108 if (cb->format == WH_FORMAT_JSON || cb->format == WH_FORMAT_KAIROSDB)
110 format_json_initialize (cb->send_buffer,
111 &cb->send_buffer_fill,
112 &cb->send_buffer_free);
114 } /* }}} wh_reset_buffer */
116 /* must hold cb->send_lock when calling */
117 static int wh_post_nolock (wh_callback_t *cb, char const *data) /* {{{ */
121 curl_easy_setopt (cb->curl, CURLOPT_POSTFIELDS, data);
122 status = curl_easy_perform (cb->curl);
124 wh_log_http_error (cb);
126 if (status != CURLE_OK)
128 ERROR ("write_http plugin: curl_easy_perform failed with "
130 status, cb->curl_errbuf);
133 } /* }}} wh_post_nolock */
135 static int wh_callback_init (wh_callback_t *cb) /* {{{ */
137 if (cb->curl != NULL)
140 cb->curl = curl_easy_init ();
141 if (cb->curl == NULL)
143 ERROR ("curl plugin: curl_easy_init failed.");
147 if (cb->low_speed_limit > 0 && cb->low_speed_time > 0)
149 curl_easy_setopt (cb->curl, CURLOPT_LOW_SPEED_LIMIT,
150 (long) (cb->low_speed_limit * cb->low_speed_time));
151 curl_easy_setopt (cb->curl, CURLOPT_LOW_SPEED_TIME,
152 (long) cb->low_speed_time);
155 #ifdef HAVE_CURLOPT_TIMEOUT_MS
157 curl_easy_setopt (cb->curl, CURLOPT_TIMEOUT_MS, (long) cb->timeout);
160 curl_easy_setopt (cb->curl, CURLOPT_NOSIGNAL, 1L);
161 curl_easy_setopt (cb->curl, CURLOPT_USERAGENT, COLLECTD_USERAGENT);
163 cb->headers = curl_slist_append (cb->headers, "Accept: */*");
164 if (cb->format == WH_FORMAT_JSON || cb->format == WH_FORMAT_KAIROSDB)
165 cb->headers = curl_slist_append (cb->headers, "Content-Type: application/json");
167 cb->headers = curl_slist_append (cb->headers, "Content-Type: text/plain");
168 cb->headers = curl_slist_append (cb->headers, "Expect:");
169 curl_easy_setopt (cb->curl, CURLOPT_HTTPHEADER, cb->headers);
171 curl_easy_setopt (cb->curl, CURLOPT_ERRORBUFFER, cb->curl_errbuf);
172 curl_easy_setopt (cb->curl, CURLOPT_URL, cb->location);
173 curl_easy_setopt (cb->curl, CURLOPT_FOLLOWLOCATION, 1L);
174 curl_easy_setopt (cb->curl, CURLOPT_MAXREDIRS, 50L);
176 if (cb->user != NULL)
178 #ifdef HAVE_CURLOPT_USERNAME
179 curl_easy_setopt (cb->curl, CURLOPT_USERNAME, cb->user);
180 curl_easy_setopt (cb->curl, CURLOPT_PASSWORD,
181 (cb->pass == NULL) ? "" : cb->pass);
183 size_t credentials_size;
185 credentials_size = strlen (cb->user) + 2;
186 if (cb->pass != NULL)
187 credentials_size += strlen (cb->pass);
189 cb->credentials = malloc (credentials_size);
190 if (cb->credentials == NULL)
192 ERROR ("curl plugin: malloc failed.");
196 ssnprintf (cb->credentials, credentials_size, "%s:%s",
197 cb->user, (cb->pass == NULL) ? "" : cb->pass);
198 curl_easy_setopt (cb->curl, CURLOPT_USERPWD, cb->credentials);
200 curl_easy_setopt (cb->curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
203 curl_easy_setopt (cb->curl, CURLOPT_SSL_VERIFYPEER, (long) cb->verify_peer);
204 curl_easy_setopt (cb->curl, CURLOPT_SSL_VERIFYHOST,
205 cb->verify_host ? 2L : 0L);
206 curl_easy_setopt (cb->curl, CURLOPT_SSLVERSION, cb->sslversion);
207 if (cb->cacert != NULL)
208 curl_easy_setopt (cb->curl, CURLOPT_CAINFO, cb->cacert);
209 if (cb->capath != NULL)
210 curl_easy_setopt (cb->curl, CURLOPT_CAPATH, cb->capath);
212 if (cb->clientkey != NULL && cb->clientcert != NULL)
214 curl_easy_setopt (cb->curl, CURLOPT_SSLKEY, cb->clientkey);
215 curl_easy_setopt (cb->curl, CURLOPT_SSLCERT, cb->clientcert);
217 if (cb->clientkeypass != NULL)
218 curl_easy_setopt (cb->curl, CURLOPT_SSLKEYPASSWD, cb->clientkeypass);
221 wh_reset_buffer (cb);
224 } /* }}} int wh_callback_init */
226 static int wh_flush_nolock (cdtime_t timeout, wh_callback_t *cb) /* {{{ */
230 DEBUG ("write_http plugin: wh_flush_nolock: timeout = %.3f; "
231 "send_buffer_fill = %zu;",
232 CDTIME_T_TO_DOUBLE (timeout),
233 cb->send_buffer_fill);
235 /* timeout == 0 => flush unconditionally */
241 if ((cb->send_buffer_init_time + timeout) > now)
245 if (cb->format == WH_FORMAT_COMMAND)
247 if (cb->send_buffer_fill == 0)
249 cb->send_buffer_init_time = cdtime ();
253 status = wh_post_nolock (cb, cb->send_buffer);
254 wh_reset_buffer (cb);
256 else if (cb->format == WH_FORMAT_JSON || cb->format == WH_FORMAT_KAIROSDB)
258 if (cb->send_buffer_fill <= 2)
260 cb->send_buffer_init_time = cdtime ();
264 status = format_json_finalize (cb->send_buffer,
265 &cb->send_buffer_fill,
266 &cb->send_buffer_free);
269 ERROR ("write_http: wh_flush_nolock: "
270 "format_json_finalize failed.");
271 wh_reset_buffer (cb);
275 status = wh_post_nolock (cb, cb->send_buffer);
276 wh_reset_buffer (cb);
280 ERROR ("write_http: wh_flush_nolock: "
281 "Unknown format: %i",
287 } /* }}} wh_flush_nolock */
289 static int wh_flush (cdtime_t timeout, /* {{{ */
290 const char *identifier __attribute__((unused)),
291 user_data_t *user_data)
296 if (user_data == NULL)
299 cb = user_data->data;
301 pthread_mutex_lock (&cb->send_lock);
303 if (wh_callback_init (cb) != 0)
305 ERROR ("write_http plugin: wh_callback_init failed.");
306 pthread_mutex_unlock (&cb->send_lock);
310 status = wh_flush_nolock (timeout, cb);
311 pthread_mutex_unlock (&cb->send_lock);
314 } /* }}} int wh_flush */
316 static void wh_callback_free (void *data) /* {{{ */
325 if (cb->send_buffer != NULL)
326 wh_flush_nolock (/* timeout = */ 0, cb);
328 if (cb->curl != NULL)
330 curl_easy_cleanup (cb->curl);
334 if (cb->headers != NULL)
336 curl_slist_free_all (cb->headers);
341 sfree (cb->location);
344 sfree (cb->credentials);
347 sfree (cb->clientkey);
348 sfree (cb->clientcert);
349 sfree (cb->clientkeypass);
350 sfree (cb->send_buffer);
353 } /* }}} void wh_callback_free */
355 static int wh_write_command (const data_set_t *ds, const value_list_t *vl, /* {{{ */
358 char key[10*DATA_MAX_NAME_LEN];
365 /* sanity checks, primarily to make static analyzers happy. */
366 if ((cb == NULL) || (cb->send_buffer == NULL))
369 if (strcmp (ds->type, vl->type) == 0) {
370 ERROR ("write_http plugin: DS type does not match "
375 /* Copy the identifier to `key' and escape it. */
376 status = FORMAT_VL (key, sizeof (key), vl);
378 ERROR ("write_http plugin: error with format_name");
381 escape_string (key, sizeof (key));
383 /* Convert the values to an ASCII representation and put that into
385 status = format_values (values, sizeof (values), ds, vl, cb->store_rates);
387 ERROR ("write_http plugin: error with "
388 "wh_value_list_to_string");
392 command_len = (size_t) ssnprintf (command, sizeof (command),
393 "PUTVAL %s interval=%.3f %s\r\n",
395 CDTIME_T_TO_DOUBLE (vl->interval),
397 if (command_len >= sizeof (command)) {
398 ERROR ("write_http plugin: Command buffer too small: "
399 "Need %zu bytes.", command_len + 1);
403 pthread_mutex_lock (&cb->send_lock);
404 if (wh_callback_init (cb) != 0)
406 ERROR ("write_http plugin: wh_callback_init failed.");
407 pthread_mutex_unlock (&cb->send_lock);
411 if (command_len >= cb->send_buffer_free)
413 status = wh_flush_nolock (/* timeout = */ 0, cb);
416 pthread_mutex_unlock (&cb->send_lock);
420 assert (command_len < cb->send_buffer_free);
422 /* `command_len + 1' because `command_len' does not include the
423 * trailing null byte. Neither does `send_buffer_fill'. */
424 memcpy (cb->send_buffer + cb->send_buffer_fill,
425 command, command_len + 1);
426 cb->send_buffer_fill += command_len;
427 cb->send_buffer_free -= command_len;
429 DEBUG ("write_http plugin: <%s> buffer %zu/%zu (%g%%) \"%s\"",
431 cb->send_buffer_fill, cb->send_buffer_size,
432 100.0 * ((double) cb->send_buffer_fill) / ((double) cb->send_buffer_size),
435 /* Check if we have enough space for this command. */
436 pthread_mutex_unlock (&cb->send_lock);
439 } /* }}} int wh_write_command */
441 static int wh_write_json (const data_set_t *ds, const value_list_t *vl, /* {{{ */
446 pthread_mutex_lock (&cb->send_lock);
447 if (wh_callback_init (cb) != 0)
449 ERROR ("write_http plugin: wh_callback_init failed.");
450 pthread_mutex_unlock (&cb->send_lock);
454 status = format_json_value_list (cb->send_buffer,
455 &cb->send_buffer_fill,
456 &cb->send_buffer_free,
457 ds, vl, cb->store_rates);
458 if (status == -ENOMEM)
460 status = wh_flush_nolock (/* timeout = */ 0, cb);
463 wh_reset_buffer (cb);
464 pthread_mutex_unlock (&cb->send_lock);
468 status = format_json_value_list (cb->send_buffer,
469 &cb->send_buffer_fill,
470 &cb->send_buffer_free,
471 ds, vl, cb->store_rates);
475 pthread_mutex_unlock (&cb->send_lock);
479 DEBUG ("write_http plugin: <%s> buffer %zu/%zu (%g%%)",
481 cb->send_buffer_fill, cb->send_buffer_size,
482 100.0 * ((double) cb->send_buffer_fill) / ((double) cb->send_buffer_size));
484 /* Check if we have enough space for this command. */
485 pthread_mutex_unlock (&cb->send_lock);
488 } /* }}} int wh_write_json */
490 static int wh_write_kairosdb (const data_set_t *ds, const value_list_t *vl, /* {{{ */
495 pthread_mutex_lock (&cb->send_lock);
497 if (cb->curl == NULL)
499 status = wh_callback_init (cb);
502 ERROR ("write_http plugin: wh_callback_init failed.");
503 pthread_mutex_unlock (&cb->send_lock);
508 status = format_kairosdb_value_list (cb->send_buffer,
509 &cb->send_buffer_fill,
510 &cb->send_buffer_free,
511 ds, vl, cb->store_rates);
512 if (status == -ENOMEM)
514 status = wh_flush_nolock (/* timeout = */ 0, cb);
517 wh_reset_buffer (cb);
518 pthread_mutex_unlock (&cb->send_lock);
522 status = format_kairosdb_value_list (cb->send_buffer,
523 &cb->send_buffer_fill,
524 &cb->send_buffer_free,
525 ds, vl, cb->store_rates);
529 pthread_mutex_unlock (&cb->send_lock);
533 DEBUG ("write_http plugin: <%s> buffer %zu/%zu (%g%%)",
535 cb->send_buffer_fill, cb->send_buffer_size,
536 100.0 * ((double) cb->send_buffer_fill) / ((double) cb->send_buffer_size));
538 /* Check if we have enough space for this command. */
539 pthread_mutex_unlock (&cb->send_lock);
542 } /* }}} int wh_write_kairosdb */
544 static int wh_write (const data_set_t *ds, const value_list_t *vl, /* {{{ */
545 user_data_t *user_data)
550 if (user_data == NULL)
553 cb = user_data->data;
554 assert (cb->send_metrics);
558 status = wh_write_json (ds, vl, cb);
560 case WH_FORMAT_KAIROSDB:
561 status = wh_write_kairosdb (ds, vl, cb);
564 status = wh_write_command (ds, vl, cb);
568 } /* }}} int wh_write */
570 static int wh_notify (notification_t const *n, user_data_t *ud) /* {{{ */
576 if ((ud == NULL) || (ud->data == NULL))
580 assert (cb->send_notifications);
582 status = format_json_notification (alert, sizeof (alert), n);
585 ERROR ("write_http plugin: formatting notification failed");
589 pthread_mutex_lock (&cb->send_lock);
590 if (wh_callback_init (cb) != 0)
592 ERROR ("write_http plugin: wh_callback_init failed.");
593 pthread_mutex_unlock (&cb->send_lock);
597 status = wh_post_nolock (cb, alert);
598 pthread_mutex_unlock (&cb->send_lock);
601 } /* }}} int wh_notify */
603 static int config_set_format (wh_callback_t *cb, /* {{{ */
608 if ((ci->values_num != 1)
609 || (ci->values[0].type != OCONFIG_TYPE_STRING))
611 WARNING ("write_http plugin: The `%s' config option "
612 "needs exactly one string argument.", ci->key);
616 string = ci->values[0].value.string;
617 if (strcasecmp ("Command", string) == 0)
618 cb->format = WH_FORMAT_COMMAND;
619 else if (strcasecmp ("JSON", string) == 0)
620 cb->format = WH_FORMAT_JSON;
621 else if (strcasecmp ("KAIROSDB", string) == 0)
622 cb->format = WH_FORMAT_KAIROSDB;
625 ERROR ("write_http plugin: Invalid format string: %s",
631 } /* }}} int config_set_format */
633 static int wh_config_append_string (const char *name, struct curl_slist **dest, /* {{{ */
636 struct curl_slist *temp = NULL;
637 if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING))
639 WARNING ("write_http plugin: `%s' needs exactly one string argument.", name);
643 temp = curl_slist_append(*dest, ci->values[0].value.string);
650 } /* }}} int wh_config_append_string */
652 static int wh_config_node (oconfig_item_t *ci) /* {{{ */
656 char callback_name[DATA_MAX_NAME_LEN];
659 cb = calloc (1, sizeof (*cb));
662 ERROR ("write_http plugin: calloc failed.");
667 cb->format = WH_FORMAT_COMMAND;
668 cb->sslversion = CURL_SSLVERSION_DEFAULT;
669 cb->low_speed_limit = 0;
671 cb->log_http_error = 0;
673 cb->send_metrics = 1;
674 cb->send_notifications = 0;
676 pthread_mutex_init (&cb->send_lock, /* attr = */ NULL);
678 cf_util_get_string (ci, &cb->name);
680 /* FIXME: Remove this legacy mode in version 6. */
681 if (strcasecmp ("URL", ci->key) == 0)
682 cf_util_get_string (ci, &cb->location);
684 for (int i = 0; i < ci->children_num; i++)
686 oconfig_item_t *child = ci->children + i;
688 if (strcasecmp ("URL", child->key) == 0)
689 status = cf_util_get_string (child, &cb->location);
690 else if (strcasecmp ("User", child->key) == 0)
691 status = cf_util_get_string (child, &cb->user);
692 else if (strcasecmp ("Password", child->key) == 0)
693 status = cf_util_get_string (child, &cb->pass);
694 else if (strcasecmp ("VerifyPeer", child->key) == 0)
695 status = cf_util_get_boolean (child, &cb->verify_peer);
696 else if (strcasecmp ("VerifyHost", child->key) == 0)
697 status = cf_util_get_boolean (child, &cb->verify_host);
698 else if (strcasecmp ("CACert", child->key) == 0)
699 status = cf_util_get_string (child, &cb->cacert);
700 else if (strcasecmp ("CAPath", child->key) == 0)
701 status = cf_util_get_string (child, &cb->capath);
702 else if (strcasecmp ("ClientKey", child->key) == 0)
703 status = cf_util_get_string (child, &cb->clientkey);
704 else if (strcasecmp ("ClientCert", child->key) == 0)
705 status = cf_util_get_string (child, &cb->clientcert);
706 else if (strcasecmp ("ClientKeyPass", child->key) == 0)
707 status = cf_util_get_string (child, &cb->clientkeypass);
708 else if (strcasecmp ("SSLVersion", child->key) == 0)
712 status = cf_util_get_string (child, &value);
716 if (value == NULL || strcasecmp ("default", value) == 0)
717 cb->sslversion = CURL_SSLVERSION_DEFAULT;
718 else if (strcasecmp ("SSLv2", value) == 0)
719 cb->sslversion = CURL_SSLVERSION_SSLv2;
720 else if (strcasecmp ("SSLv3", value) == 0)
721 cb->sslversion = CURL_SSLVERSION_SSLv3;
722 else if (strcasecmp ("TLSv1", value) == 0)
723 cb->sslversion = CURL_SSLVERSION_TLSv1;
724 #if (LIBCURL_VERSION_MAJOR > 7) || (LIBCURL_VERSION_MAJOR == 7 && LIBCURL_VERSION_MINOR >= 34)
725 else if (strcasecmp ("TLSv1_0", value) == 0)
726 cb->sslversion = CURL_SSLVERSION_TLSv1_0;
727 else if (strcasecmp ("TLSv1_1", value) == 0)
728 cb->sslversion = CURL_SSLVERSION_TLSv1_1;
729 else if (strcasecmp ("TLSv1_2", value) == 0)
730 cb->sslversion = CURL_SSLVERSION_TLSv1_2;
734 ERROR ("write_http plugin: Invalid SSLVersion "
735 "option: %s.", value);
741 else if (strcasecmp ("Format", child->key) == 0)
742 status = config_set_format (cb, child);
743 else if (strcasecmp ("Metrics", child->key) == 0)
744 cf_util_get_boolean (child, &cb->send_metrics);
745 else if (strcasecmp ("Notifications", child->key) == 0)
746 cf_util_get_boolean (child, &cb->send_notifications);
747 else if (strcasecmp ("StoreRates", child->key) == 0)
748 status = cf_util_get_boolean (child, &cb->store_rates);
749 else if (strcasecmp ("BufferSize", child->key) == 0)
750 status = cf_util_get_int (child, &buffer_size);
751 else if (strcasecmp ("LowSpeedLimit", child->key) == 0)
752 status = cf_util_get_int (child, &cb->low_speed_limit);
753 else if (strcasecmp ("Timeout", child->key) == 0)
754 status = cf_util_get_int (child, &cb->timeout);
755 else if (strcasecmp ("LogHttpError", child->key) == 0)
756 status = cf_util_get_boolean (child, &cb->log_http_error);
757 else if (strcasecmp ("Header", child->key) == 0)
758 status = wh_config_append_string ("Header", &cb->headers, child);
761 ERROR ("write_http plugin: Invalid configuration "
762 "option: %s.", child->key);
772 wh_callback_free (cb);
776 if (cb->location == NULL)
778 ERROR ("write_http plugin: no URL defined for instance '%s'",
780 wh_callback_free (cb);
784 if (!cb->send_metrics && !cb->send_notifications)
786 ERROR ("write_http plugin: Neither metrics nor notifications "
787 "are enabled for \"%s\".", cb->name);
788 wh_callback_free (cb);
792 if (cb->low_speed_limit > 0)
793 cb->low_speed_time = CDTIME_T_TO_TIME_T(plugin_get_interval());
795 /* Determine send_buffer_size. */
796 cb->send_buffer_size = WRITE_HTTP_DEFAULT_BUFFER_SIZE;
797 if (buffer_size >= 1024)
798 cb->send_buffer_size = (size_t) buffer_size;
799 else if (buffer_size != 0)
800 ERROR ("write_http plugin: Ignoring invalid BufferSize setting (%d).",
803 /* Allocate the buffer. */
804 cb->send_buffer = malloc (cb->send_buffer_size);
805 if (cb->send_buffer == NULL)
807 ERROR ("write_http plugin: malloc(%zu) failed.", cb->send_buffer_size);
808 wh_callback_free (cb);
811 /* Nulls the buffer and sets ..._free and ..._fill. */
812 wh_reset_buffer (cb);
814 ssnprintf (callback_name, sizeof (callback_name), "write_http/%s",
816 DEBUG ("write_http: Registering write callback '%s' with URL '%s'",
817 callback_name, cb->location);
819 user_data_t user_data = {
821 .free_func = wh_callback_free,
824 if (cb->send_metrics)
826 plugin_register_write (callback_name, wh_write, &user_data);
827 user_data.free_func = NULL;
829 plugin_register_flush (callback_name, wh_flush, &user_data);
832 if (cb->send_notifications)
834 plugin_register_notification (callback_name, wh_notify, &user_data);
835 user_data.free_func = NULL;
839 } /* }}} int wh_config_node */
841 static int wh_config (oconfig_item_t *ci) /* {{{ */
843 for (int i = 0; i < ci->children_num; i++)
845 oconfig_item_t *child = ci->children + i;
847 if (strcasecmp ("Node", child->key) == 0)
848 wh_config_node (child);
849 /* FIXME: Remove this legacy mode in version 6. */
850 else if (strcasecmp ("URL", child->key) == 0) {
851 WARNING ("write_http plugin: Legacy <URL> block found. "
852 "Please use <Node> instead.");
853 wh_config_node (child);
857 ERROR ("write_http plugin: Invalid configuration "
858 "option: %s.", child->key);
863 } /* }}} int wh_config */
865 static int wh_init (void) /* {{{ */
867 /* Call this while collectd is still single-threaded to avoid
868 * initialization issues in libgcrypt. */
869 curl_global_init (CURL_GLOBAL_SSL);
871 } /* }}} int wh_init */
873 void module_register (void) /* {{{ */
875 plugin_register_complex_config ("write_http", wh_config);
876 plugin_register_init ("write_http", wh_init);
877 } /* }}} void module_register */
879 /* vim: set fdm=marker sw=8 ts=8 tw=78 et : */