Merge pull request #5995 from Icinga/fix/influxdb-requests

Fix InfluxDB requests
This commit is contained in:
Gunnar Beutner 2018-01-17 10:28:15 +01:00 committed by GitHub
commit 71a032579b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -321,6 +321,9 @@ String InfluxdbWriter::EscapeValue(const Value& value)
if (value.IsBoolean())
return value ? "true" : "false";
if (value.IsString())
return "\"" + EscapeKeyOrTagValue(value) + "\"";
return value;
}

View File

@ -207,6 +207,11 @@ bool HttpResponse::Parse(StreamReadContext& src, bool may_wait)
lengthIndicator = Convert::ToLong(contentLengthHeader);
}
if (!hasLengthIndicator && ProtocolVersion != HttpVersion10 && !Headers->Contains("transfer-encoding")) {
Complete = true;
return true;
}
if (hasLengthIndicator && src.Eof)
BOOST_THROW_EXCEPTION(std::invalid_argument("Unexpected EOF in HTTP body"));