]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix `telnet-option-loop', I think. (Untested except to check it
authorSimon Tatham <anakin@pobox.com>
Wed, 16 Mar 2005 13:20:02 +0000 (13:20 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 16 Mar 2005 13:20:02 +0000 (13:20 +0000)
compiles, since I don't have a suitably awkward server to run it
against; but Ben reviewed the patch before checkin so we can share
the blame if it doesn't work.)

[originally from svn r5512]
[this svn revision also touched putty-wishlist]

telnet.c

index 54b9a7c7db875fc1d6dd207acd97ff5275da159b..fe6f5cf94507ab8c600c9cab3f01c0071563a832 100644 (file)
--- a/telnet.c
+++ b/telnet.c
@@ -394,9 +394,12 @@ static void proc_rec_opt(Telnet telnet, int cmd, int option)
     }
     /*
      * If we reach here, the option was one we weren't prepared to
-     * cope with. So send a negative ack.
+     * cope with. If the request was positive (WILL or DO), we send
+     * a negative ack to indicate refusal. If the request was
+     * negative (WONT / DONT), we must do nothing.
      */
-    send_opt(telnet, (cmd == WILL ? DONT : WONT), option);
+    if (cmd == WILL || cmd == DO)
+        send_opt(telnet, (cmd == WILL ? DONT : WONT), option);
 }
 
 static void process_subneg(Telnet telnet)