From: Evan Broder Date: Wed, 29 Oct 2008 02:53:32 +0000 (-0400) Subject: File reads are cheap. Don't cache the VNC token key in the server code X-Git-Tag: 0.0.2^0 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-vnc-server.git/commitdiff_plain/cdca204482db7c91fec57797db37de2d28250b9e File reads are cheap. Don't cache the VNC token key in the server code svn path=/trunk/packages/invirt-vnc-server/; revision=1403 --- diff --git a/debian/changelog b/debian/changelog index 4600adf..ca209d5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 + * File reads are cheap. Especially when the file is short. Don't cache + the token key - -- Evan Broder Tue, 28 Oct 2008 21:19:14 -0400 + -- Evan Broder Tue, 28 Oct 2008 22:48:24 -0400 invirt-vnc-server (0.0.1) unstable; urgency=low diff --git a/python/vnc/extauth.py b/python/vnc/extauth.py index b7351a3..a2cd570 100644 --- a/python/vnc/extauth.py +++ b/python/vnc/extauth.py @@ -20,10 +20,7 @@ import socket 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