File reads are cheap. Don't cache the VNC token key in the server code 0.0.2
authorEvan Broder <broder@mit.edu>
Wed, 29 Oct 2008 02:53:32 +0000 (22:53 -0400)
committerEvan Broder <broder@mit.edu>
Wed, 29 Oct 2008 02:53:32 +0000 (22:53 -0400)
svn path=/trunk/packages/invirt-vnc-server/; revision=1403

debian/changelog
python/vnc/extauth.py

index 4600adf..ca209d5 100644 (file)
@@ -2,8 +2,10 @@ invirt-vnc-server (0.0.2) unstable; urgency=low
 
   * Cleanup the init script to use /lib/init/std-init.sh
   * Generate the SSL certificates at install-time
 
   * Cleanup the init script to use /lib/init/std-init.sh
   * Generate the SSL certificates at install-time
+  * File reads are cheap. Especially when the file is short. Don't cache
+    the token key
 
 
- -- Evan Broder <broder@mit.edu>  Tue, 28 Oct 2008 21:19:14 -0400
+ -- Evan Broder <broder@mit.edu>  Tue, 28 Oct 2008 22:48:24 -0400
 
 invirt-vnc-server (0.0.1) unstable; urgency=low
 
 
 invirt-vnc-server (0.0.1) unstable; urgency=low
 
index b7351a3..a2cd570 100644 (file)
@@ -20,10 +20,7 @@ import socket
 import time
 
 def getTokenKey():
 import time
 
 def getTokenKey():
-    token_key = file('/etc/invirt/secrets/vnc-key').read().strip()
-    while True:
-        yield token_key
-getTokenKey = getTokenKey().next
+    return file('/etc/invirt/secrets/vnc-key').read().strip()
 
 def getPort(name, auth_data):
     import get_port
 
 def getPort(name, auth_data):
     import get_port