Rename "initial" state to "telopt_negotiation"
authorJeremy Stanley <fungi@yuggoth.org>
Sun, 8 Jul 2018 18:55:53 +0000 (18:55 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Sun, 8 Jul 2018 18:55:53 +0000 (18:55 +0000)
There was a rare race where if a client disconnected during the
initial Telnet option negotiation pause, an attempt to log an entry
about it would raise an exception because the "initial" state
placeholder in the default menu data was incorrectly-named. Fix
that, and rename the state to "telopt_negotiation" so it's less
confusing to debug if similar issues are discovered with this state
in the future.

mudpy/misc.py
share/menu.yaml

index 66d97a8..3cd8e64 100644 (file)
@@ -525,7 +525,7 @@ class User:
         self.output_queue = []
         self.partial_input = b""
         self.password_tries = 0
-        self.state = "initial"
+        self.state = "telopt_negotiation"
         self.telopts = {}
 
     def quit(self):
@@ -806,7 +806,7 @@ class User:
             self.check_idle()
 
         # if output is paused, decrement the counter
-        if self.state == "initial":
+        if self.state == "telopt_negotiation":
             if self.negotiation_pause:
                 self.negotiation_pause -= 1
             else:
index 2f756b0..07a4601 100644 (file)
@@ -108,7 +108,7 @@ menu.entering_new_password.prompt: 'Enter a new password for "$(account)":'
 menu.entering_new_password.error_differs: The two passwords did not match. Try
     again...
 
-menu.active.initial:
+menu.telopt_negotiation.prompt:
 
 menu.main_utility.action_c: user.new_avatar()
 menu.main_utility.branch_a: activate_avatar