From cdca204482db7c91fec57797db37de2d28250b9e Mon Sep 17 00:00:00 2001 From: Evan Broder Date: Tue, 28 Oct 2008 22:53:32 -0400 Subject: [PATCH 1/1] File reads are cheap. Don't cache the VNC token key in the server code svn path=/trunk/packages/invirt-vnc-server/; revision=1403 --- debian/changelog | 4 +++- python/vnc/extauth.py | 5 +---- 2 files changed, 4 insertions(+), 5 deletions(-) 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 -- 1.7.9.5