Support --enable-debug-logs=no option of configure script (#2)

* Support --enable-debug-logs=no option of configure script

* Undo unintended white space changes

* Undo more unintended white space changes

* Address review comments - thanks Mirko

* Address more review comments - thanks Mirko
This commit is contained in:
michaelgranzow-avi
2017-08-03 19:50:43 +02:00
committed by Felipe Zimmerle
parent 1d3c4c670d
commit 3a048ee2db
22 changed files with 305 additions and 4 deletions

View File

@@ -50,7 +50,9 @@ bool ValidateSchema::evaluate(Transaction *t,
if (m_err.empty() == false) {
err << m_err;
}
#ifndef NO_LOGS
t->debug(4, err.str());
#endif
return true;
}
@@ -73,7 +75,9 @@ bool ValidateSchema::evaluate(Transaction *t,
if (m_err.empty() == false) {
err << " " << m_err;
}
#ifndef NO_LOGS
t->debug(4, err.str());
#endif
xmlSchemaFreeParserCtxt(m_parserCtx);
return true;
}
@@ -84,7 +88,9 @@ bool ValidateSchema::evaluate(Transaction *t,
if (m_err.empty() == false) {
err << " " << m_err;
}
#ifndef NO_LOGS
t->debug(4, err.str());
#endif
return true;
}
@@ -94,36 +100,46 @@ bool ValidateSchema::evaluate(Transaction *t,
(xmlSchemaValidityWarningFunc)warn_runtime, t);
if (t->m_xml->m_data.doc == NULL) {
#ifndef NO_LOGS
t->debug(4, "XML document tree could not be found for " \
"schema validation.");
#endif
return true;
}
if (t->m_xml->m_data.well_formed != 1) {
#ifndef NO_LOGS
t->debug(4, "XML: Schema validation failed because " \
"content is not well formed.");
#endif
return true;
}
/* Make sure there were no other generic processing errors */
/*
if (msr->msc_reqbody_error) {
#ifndef NO_LOGS
t->debug(4, "XML: Schema validation could not proceed due to previous"
" processing errors.");
#endif
return true;
}
*/
rc = xmlSchemaValidateDoc(m_validCtx, t->m_xml->m_data.doc);
if (rc != 0) {
t->debug(4, "XML: Schema validation failed.");
#ifndef NO_LOGS
t->debug(4, "XML: Schema validation failed.");
#endif
xmlSchemaFree(m_schema);
xmlSchemaFreeParserCtxt(m_parserCtx);
return true; /* No match. */
}
#ifndef NO_LOGS
t->debug(4, "XML: Successfully validated payload against " \
"Schema: " + m_resource);
#endif
return false;
}