[Spice-commits] Branch '0.10' - 4 commits - client/application.cpp client/application.h client/controller.cpp client/controller.h client/tests

Alon Levy alon at kemper.freedesktop.org
Tue Feb 28 04:43:23 PST 2012


 client/application.cpp                           |    5 +++++
 client/application.h                             |    1 +
 client/controller.cpp                            |    5 ++++-
 client/controller.h                              |    1 +
 client/tests/controller_test/README.txt          |   10 ++++++++++
 client/tests/controller_test/controller_test.cpp |   10 +++++++---
 6 files changed, 28 insertions(+), 4 deletions(-)

New commits:
commit 547d5081262921087d3c1e0a9c8b2ed19d3a9135
Author: Alon Levy <alevy at redhat.com>
Date:   Sun Feb 26 17:42:50 2012 +0100

    controller_test: add README

diff --git a/client/tests/controller_test/README.txt b/client/tests/controller_test/README.txt
new file mode 100644
index 0000000..aa2536a
--- /dev/null
+++ b/client/tests/controller_test/README.txt
@@ -0,0 +1,10 @@
+To run the test:
+
+terminal 1:
+export SPICE_XPI_SOCKET=/tmp/SpiceController-0.uds
+spicec --controller
+
+terminal 2:
+./spice_controller <hostname> <port number>
+
+repeated enters to go between checks.
commit 0c6c93df1c8fba7a4105442af848fbf808663a89
Author: Alon Levy <alevy at redhat.com>
Date:   Sun Feb 26 17:41:23 2012 +0100

    client controller_test: reorder parameters since pid isn't needed for linux client test

diff --git a/client/tests/controller_test/controller_test.cpp b/client/tests/controller_test/controller_test.cpp
index aa7a6c0..82b3166 100644
--- a/client/tests/controller_test/controller_test.cpp
+++ b/client/tests/controller_test/controller_test.cpp
@@ -121,9 +121,9 @@ DWORD read_from_pipe(LPVOID data, DWORD size)
 
 int main(int argc, char *argv[])
 {
-    int spicec_pid = (argc > 1 ? atoi(argv[1]) : 0);
-    char* host = (argc > 2 ? argv[2] : (char*)HOST);
-    int port = (argc > 3 ? atoi(argv[3]) : PORT);
+    int spicec_pid = (argc > 3 ? atoi(argv[3]) : 0);
+    char* host = (argc > 1 ? argv[1] : (char*)HOST);
+    int port = (argc > 2 ? atoi(argv[2]) : PORT);
     TCHAR pipe_name[PIPE_NAME_MAX_LEN];
     ControllerValue msg;
     DWORD read;
commit 7f1ed9283fd69b237938db9fd8de73f1ce9b84ce
Author: Alon Levy <alevy at redhat.com>
Date:   Sun Feb 26 12:45:28 2012 +0100

    client: handle CONTROLLER_ENABLE_SMARTCARD (rhbz 641828)

diff --git a/client/application.cpp b/client/application.cpp
index 08fa4fc..cecc712 100644
--- a/client/application.cpp
+++ b/client/application.cpp
@@ -1689,6 +1689,11 @@ void Application::set_title(const std::string& title)
     }
 }
 
+void Application::enable_smartcard(bool enable)
+{
+    _smartcard_options->enable = enable;
+}
+
 bool Application::is_key_set_pressed(const HotkeySet& key_set)
 {
     HotkeySet::const_iterator iter = key_set.begin();
diff --git a/client/application.h b/client/application.h
index ac51cd2..72501dd 100644
--- a/client/application.h
+++ b/client/application.h
@@ -227,6 +227,7 @@ public:
     void external_show();
     void connect();
     void switch_host(const std::string& host, int port, int sport, const std::string& cert_subject);
+    void enable_smartcard(bool enable);
 
     const PeerConnectionOptMap& get_con_opt_map() {return _peer_con_opt;}
     const RedPeer::HostAuthOptions& get_host_auth_opt() { return _host_auth_opt;}
diff --git a/client/controller.cpp b/client/controller.cpp
index 91c0021..a0269be 100644
--- a/client/controller.cpp
+++ b/client/controller.cpp
@@ -334,9 +334,12 @@ bool ControllerConnection::handle_message(ControllerMsg *hdr)
     case CONTROLLER_DELETE_MENU:
         _handler->delete_menu();
         break;
+    case CONTROLLER_ENABLE_SMARTCARD:
+        _handler->enable_smartcard(value);
+        break;
     case CONTROLLER_SEND_CAD:
     default:
-        LOG_ERROR("Ignoring an unknown controller message %u", hdr->id);
+        LOG_ERROR("Ignoring an unknown/SEND_CAD controller message %u", hdr->id);
         return false;
     }
     return true;
diff --git a/client/controller.h b/client/controller.h
index bf92707..ef996e9 100644
--- a/client/controller.h
+++ b/client/controller.h
@@ -50,6 +50,7 @@ public:
     virtual Menu* get_app_menu() = 0;
     virtual void set_menu(Menu* menu) = 0;
     virtual void delete_menu() = 0;
+    virtual void enable_smartcard(bool enable) = 0;
 };
 
 class Controller : public NamedPipe::ListenerInterface {
commit 8b0dcb5e0cf5a5acfbbb0ee4bb815a0bf710d41b
Author: Alon Levy <alevy at redhat.com>
Date:   Sun Feb 26 12:32:02 2012 +0100

    controller_test: add ENABLE_SMARTCARD

diff --git a/client/tests/controller_test/controller_test.cpp b/client/tests/controller_test/controller_test.cpp
index 4994613..aa7a6c0 100644
--- a/client/tests/controller_test/controller_test.cpp
+++ b/client/tests/controller_test/controller_test.cpp
@@ -169,6 +169,10 @@ int main(int argc, char *argv[])
 
     send_data(CONTROLLER_CREATE_MENU, (uint8_t*)MENU, sizeof(MENU));
 
+    printf("Smartcard...\n");
+    getchar();
+    send_value(CONTROLLER_ENABLE_SMARTCARD, 1);
+
     send_value(CONTROLLER_FULL_SCREEN, /*CONTROLLER_SET_FULL_SCREEN |*/ CONTROLLER_AUTO_DISPLAY_RES);
     printf("Show...\n");
     getchar();


More information about the Spice-commits mailing list