fixup! Fix the XmlTraceLogFormatter (#7322)

* fixup! Fix the XmlTraceLogFormatter

The original escape process uses a `loop` while the code is actually not
an ACTOR. So the actorcompiler is not reacting. This causes the escape
not escaping the XML fields properly.

* fixup! Reformat source
This commit is contained in:
Xiaoge Su 2022-06-13 13:38:17 -07:00 committed by GitHub
parent e632aef1c7
commit 5a2804e04b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -20,7 +20,6 @@
#include "flow/flow.h"
#include "flow/XmlTraceLogFormatter.h"
#include "flow/actorcompiler.h"
void XmlTraceLogFormatter::addref() {
ReferenceCounted<XmlTraceLogFormatter>::addref();
@ -43,7 +42,7 @@ const char* XmlTraceLogFormatter::getFooter() const {
}
void XmlTraceLogFormatter::escape(std::ostringstream& oss, std::string source) const {
loop {
for (;;) {
int index = source.find_first_of(std::string({ '&', '"', '<', '>', '\r', '\n', '\0' }));
if (index == source.npos) {
break;