Skip to content

Commit b18e9ca

Browse files
authored
Convert empty string into quotes when sending it to InfluxDB (#256)
1 parent c0b6e00 commit b18e9ca

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ endif()
1717

1818
# Define project
1919
project(Monitoring
20-
VERSION 3.8.6
20+
VERSION 3.8.7
2121
DESCRIPTION "O2 Monitoring library"
2222
LANGUAGES CXX
2323
)

src/Backends/InfluxDB.cxx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ void InfluxDB::escape(std::string& escaped)
5454
boost::replace_all(escaped, ",", "\\,");
5555
boost::replace_all(escaped, "=", "\\=");
5656
boost::replace_all(escaped, " ", "\\ ");
57+
if (escaped.empty()) {
58+
escaped = R"("")";
59+
}
5760
}
5861

5962
void InfluxDB::send(std::vector<Metric>&& metrics)

0 commit comments

Comments
 (0)