summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>2022-12-14 17:26:55 +0100
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>2022-12-14 17:26:55 +0100
commit5b2969f43113b03ba8d66846b052008149443c41 (patch)
treeaff3e74d5b53774035d342d4f4af73390f795ed1
parent41b53ee51ed5fb6349781cd848d2f2141cd4c985 (diff)
downloadcert-svc-5b2969f43113b03ba8d66846b052008149443c41.tar.gz
cert-svc-5b2969f43113b03ba8d66846b052008149443c41.tar.bz2
cert-svc-5b2969f43113b03ba8d66846b052008149443c41.zip
Update xmlsec callback logging
The main purpose of this commit is to help with debugging memory leaks in a client app. * Log file closing callback to make sure that files are closed eventually. * Log only filename without the prefix in file opening callback. The prefix is logged elsewhere anyway. This is to avoid log truncating on some images. Change-Id: I20bd376c18b9c2f0ab865cf9dccdaf8cedbec202
-rw-r--r--src/vcore/XmlsecAdapter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/vcore/XmlsecAdapter.cpp b/src/vcore/XmlsecAdapter.cpp
index 92e8dc5..477a229 100644
--- a/src/vcore/XmlsecAdapter.cpp
+++ b/src/vcore/XmlsecAdapter.cpp
@@ -75,8 +75,9 @@ int XmlSec::fileMatchCallback(const char *filename)
void *XmlSec::fileOpenCallback(const char *filename)
{
+ LogDebug("Xmlsec opening:" << filename);
+
std::string path = s_prefixPath + filename;
- LogDebug("Xmlsec opening : " << path);
return new FileWrapper(xmlFileOpen(path.c_str()), false);
}
@@ -101,6 +102,8 @@ int XmlSec::fileReadCallback(void *context,
int XmlSec::fileCloseCallback(void *context)
{
+ LogDebug("Xmlsec closing");
+
FileWrapper *fw = static_cast<FileWrapper *>(context);
int output = 0;
@@ -224,7 +227,7 @@ XmlSec::~XmlSec()
void XmlSec::validateFile(XmlSecContext &context, xmlSecKeysMngrPtr mngrPtr)
{
fileExtractPrefix(context);
- LogDebug("Prefix path : " << s_prefixPath);
+ LogDebug("Prefix:" << s_prefixPath);
xmlSecIOCleanupCallbacks();
if (xmlSecIORegisterCallbacks(
fileMatchCallback,