On 04/03/2012 07:12 PM, David Jaša wrote:
Hi Christophe,
Christophe Fergeau píše v Út 03. 04. 2012 v 16:38 +0200:
The secure channel names need to be fixed for compatibility with
older spice versions. However, it's better to do it directly when
m_secure_channels is set rather than waiting until its first use
---
SpiceXPI/src/plugin/plugin.cpp | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp
index e3e6e80..04d272b 100644
--- a/SpiceXPI/src/plugin/plugin.cpp
+++ b/SpiceXPI/src/plugin/plugin.cpp
@@ -329,6 +329,20 @@ char *nsPluginInstance::GetSSLChannels() const
void nsPluginInstance::SetSSLChannels(const char *aSSLChannels)
{
m_ssl_channels = aSSLChannels;
+
+ /*
+ * HACK -- remove leading s from m_SSLChannels, e.g. "main" not "smain"
+ * RHEL5 uses 'smain' and 'sinpusts
+ * RHEL6 uses 'main' and 'inputs'
+ */
The s- idio^W^W^W^Wlegacy goes much further, see the ovirt-engine
sources what you can expect:
http://gerrit.ovirt.org/gitweb?p=ovirt-engine.git;a=blob;f=backend/manager/tools/engine-config/src/main/resources/engine-config.properties#l109
David
Hi David,
Yes, we need to support all legacy channel names.
Are you able to test it ? Does the attached patch fix that for you?
Thanks,
Uri
From 4540b3a67fcd6dc96c77354b70cd6510fd22f5b0 Mon Sep 17 00:00:00 2001
From: Uri Lublin <u...@redhat.com>
Date: Sun, 8 Apr 2012 16:56:01 +0300
Subject: [PATCH] SetSSLChannels: remove leading s off all spice channel names
---
SpiceXPI/src/plugin/plugin.cpp | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/SpiceXPI/src/plugin/plugin.cpp b/SpiceXPI/src/plugin/plugin.cpp
index 8acde24..956c9d3 100644
--- a/SpiceXPI/src/plugin/plugin.cpp
+++ b/SpiceXPI/src/plugin/plugin.cpp
@@ -334,13 +334,19 @@ void nsPluginInstance::SetSSLChannels(const char
*aSSLChannels)
* RHEL5 uses 'smain' and 'sinpusts
* RHEL6 uses 'main' and 'inputs'
*/
- std::size_t found = 0;
- while ((found = m_ssl_channels.find("smain", found)) != std::string::npos)
- m_ssl_channels.replace(found, 5, "main");
-
- found = 0;
- while ((found = m_ssl_channels.find("sinputs", found)) !=
std::string::npos)
- m_ssl_channels.replace(found, 7, "inputs");
+ size_t found;
+ const char* chan_names[] = {"smain" , "sdisplay", "sinputs" , "scursor",
+ "splayback", "srecord"};
+ const int nnames = sizeof(chan_names) / sizeof(chan_names[0]);
+ int i;
+
+ for (i=0; i < nnames; i++) {
+ const char *name = chan_names[i];
+ found = 0;
+ while ((found = m_ssl_channels.find(name, found)) !=
std::string::npos) {
+ m_ssl_channels.replace(found, strlen(name), name+1);
+ }
+ }
/* HACK */
}
--
1.7.1
_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel