[PATCH 2/3] Drop the connection if some credentials cannot be set.



---
 examples/gvncviewer.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/examples/gvncviewer.py b/examples/gvncviewer.py
index 2debf76..9a74268 100644
--- a/examples/gvncviewer.py
+++ b/examples/gvncviewer.py
@@ -131,7 +131,9 @@ def vnc_auth_cred(src, credList):
 
     for i in range(len(credList)):
         if i < len(data) and data[i] != None:
-            src.set_credential(credList[i], data[i])
+            if src.set_credential(credList[i], data[i]):
+                print "Cannot set credential type %d" % (credList[i])
+                src.close()
         else:
             print "Unsupported credential type %d" % (credList[i])
             src.close()
-- 
1.6.2.5



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]