[Spice-devel] [spice-xpi PATCH 2/3] logging: add logging of messages sent to the client (#753155)
Uri Lublin
uril at redhat.com
Sun Jan 1 04:19:28 PST 2012
Password is not logged.
---
SpiceXPI/src/plugin/plugin.cpp | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp
index 0b2ec4e..a48c94f 100644
--- a/SpiceXPI/src/plugin/plugin.cpp
+++ b/SpiceXPI/src/plugin/plugin.cpp
@@ -511,12 +511,14 @@ void nsPluginInstance::SendInit()
{
ControllerInit msg = { {CONTROLLER_MAGIC, CONTROLLER_VERSION, sizeof(msg)},
0, CONTROLLER_FLAG_EXCLUSIVE };
+ DBG(0, "sending init");
WriteToPipe(&msg, sizeof(msg));
}
void nsPluginInstance::SendMsg(uint32_t id)
{
ControllerMsg msg = {id, sizeof(msg)};
+ DBG(0, "sending msg id " << id);
WriteToPipe(&msg, sizeof(msg));
}
@@ -526,6 +528,7 @@ void nsPluginInstance::SendValue(uint32_t id, uint32_t value)
return;
ControllerValue msg = { {id, sizeof(msg)}, value };
+ DBG(0, "sending msg id " << id << " value " << value);
WriteToPipe(&msg, sizeof(msg));
}
@@ -539,6 +542,11 @@ void nsPluginInstance::SendStr(uint32_t id, const char *str)
msg->base.id = id;
msg->base.size = size;
strcpy(reinterpret_cast<char *>(msg->data), str);
+ if (id == CONTROLLER_PASSWORD) {
+ DBG(0, "sending password");
+ } else {
+ DBG(0, "sending msg id " << id << " str " << str);
+ }
WriteToPipe(msg, size);
free(msg);
}
@@ -554,6 +562,7 @@ void nsPluginInstance::SendWStr(uint32_t id, const wchar_t *str)
msg->base.id = id;
msg->base.size = size;
wcscpy(reinterpret_cast<wchar_t *>(msg->data), str);
+ DBG(0, "sending msg id " << id << " wstr " << str);
WriteToPipe(msg, size);
free(msg);
}
--
1.7.1
More information about the Spice-devel
mailing list