static size_t apache_curl_callback(void *buf, size_t size, size_t nmemb,
void *user_data) {
static size_t apache_curl_callback(void *buf, size_t size, size_t nmemb,
void *user_data) {
static size_t apache_header_callback(void *buf, size_t size, size_t nmemb,
void *user_data) {
static size_t apache_header_callback(void *buf, size_t size, size_t nmemb,
void *user_data) {
- int status;
-
- status = snprintf(credentials, sizeof(credentials), "%s:%s", st->user,
- (st->pass == NULL) ? "" : st->pass);
+ int 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 "
"because the credentials have been "
if ((status < 0) || ((size_t)status >= sizeof(credentials))) {
ERROR("apache plugin: init_host: Returning an error "
"because the credentials have been "
- status = curl_easy_getinfo(st->curl, CURLINFO_CONTENT_TYPE, &content_type);
+ char *content_type;
+ static const char *text_plain = "text/plain";
+ int status =
+ curl_easy_getinfo(st->curl, CURLINFO_CONTENT_TYPE, &content_type);
if ((status == CURLE_OK) && (content_type != NULL) &&
(strncasecmp(content_type, text_plain, strlen(text_plain)) != 0)) {
WARNING("apache plugin: `Content-Type' response header is not `%s' "
if ((status == CURLE_OK) && (content_type != NULL) &&
(strncasecmp(content_type, text_plain, strlen(text_plain)) != 0)) {
WARNING("apache plugin: `Content-Type' response header is not `%s' "