temp = realloc(st->apache_buffer, st->apache_buffer_fill + len + 1);
if (temp == NULL) {
ERROR("apache plugin: realloc failed.");
temp = realloc(st->apache_buffer, st->apache_buffer_fill + len + 1);
if (temp == NULL) {
ERROR("apache plugin: realloc failed.");
} /* int apache_curl_callback */
static size_t apache_header_callback(void *buf, size_t size, size_t nmemb,
} /* int apache_curl_callback */
static size_t apache_header_callback(void *buf, size_t size, size_t nmemb,
/* look for the Server header */
if (strncasecmp(buf, "Server: ", strlen("Server: ")) != 0)
/* look for the Server header */
if (strncasecmp(buf, "Server: ", strlen("Server: ")) != 0)
if (strstr(buf, "Apache") != NULL)
st->server_type = APACHE;
if (strstr(buf, "Apache") != NULL)
st->server_type = APACHE;
st = calloc(1, sizeof(*st));
if (st == NULL) {
ERROR("apache plugin: calloc failed.");
st = calloc(1, sizeof(*st));
if (st == NULL) {
ERROR("apache plugin: calloc failed.");
- ssnprintf(callback_name, sizeof(callback_name), "apache/%s/%s",
+ snprintf(callback_name, sizeof(callback_name), "apache/%s/%s",
(st->host != NULL) ? st->host : hostname_g,
(st->name != NULL) ? st->name : "default");
(st->host != NULL) ? st->host : hostname_g,
(st->name != NULL) ? st->name : "default");
if ((st->curl = curl_easy_init()) == NULL) {
ERROR("apache plugin: init_host: `curl_easy_init' failed.");
if ((st->curl = curl_easy_init()) == NULL) {
ERROR("apache plugin: init_host: `curl_easy_init' failed.");
- status = ssnprintf(credentials, sizeof(credentials), "%s:%s", st->user,
+ status = snprintf(credentials, sizeof(credentials), "%s:%s", st->user,
(st->pass == NULL) ? "" : st->pass);
if ((status < 0) || ((size_t)status >= sizeof(credentials))) {
ERROR("apache plugin: init_host: Returning an error "
(st->pass == NULL) ? "" : st->pass);
if ((status < 0) || ((size_t)status >= sizeof(credentials))) {
ERROR("apache plugin: init_host: Returning an error "
} /* }}} int init_host */
static void submit_value(const char *type, const char *type_instance,
} /* }}} int init_host */
static void submit_value(const char *type, const char *type_instance,
}
assert(st->curl != NULL);
st->apache_buffer_fill = 0;
if (curl_easy_perform(st->curl) != CURLE_OK) {
ERROR("apache: curl_easy_perform failed: %s", st->apache_curl_error);
}
assert(st->curl != NULL);
st->apache_buffer_fill = 0;
if (curl_easy_perform(st->curl) != CURLE_OK) {
ERROR("apache: curl_easy_perform failed: %s", st->apache_curl_error);
/* Call this while collectd is still single-threaded to avoid
* initialization issues in libgcrypt. */
curl_global_init(CURL_GLOBAL_SSL);
/* Call this while collectd is still single-threaded to avoid
* initialization issues in libgcrypt. */
curl_global_init(CURL_GLOBAL_SSL);