浏览代码

fix crash

svn:r3927
Nick Mathewson 20 年之前
父节点
当前提交
85c6d25e5b
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      contrib/ExerciseServer.py

+ 2 - 1
contrib/ExerciseServer.py

@@ -86,7 +86,8 @@ def handleEvent(s, body, circs, streamsByNonce, streamsByIdent):
         elif status in (TorControl.STREAM_STATUS.CLOSED,
                         TorControl.STREAM_STATUS.FAILED):
             circid, (host,url) = streamsByIdent[ident]
-            del circs[circid]
+            if circs.has_key(circid):
+                del circs[circid]
             del streamsByIdent[ident]
     elif event == TorControl.EVENT_TYPE.CIRCSTATUS:
         status, ident, path = args