changeset 2363:fa4c11751367

Give a response to unknown SSH commands
author Matt Mackall <mpm@selenic.com>
date Sun, 04 Jun 2006 18:05:52 +0100
parents 482d3fb47d80
children e9d402506514
files mercurial/commands.py
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Jun 01 19:08:29 2006 +0200
+++ b/mercurial/commands.py	Sun Jun 04 18:05:52 2006 +0100
@@ -2476,13 +2476,13 @@
             cmd = fin.readline()[:-1]
             if cmd == '':
                 return
-            if cmd == "heads":
+            elif cmd == "heads":
                 h = repo.heads()
                 respond(" ".join(map(hex, h)) + "\n")
-            if cmd == "lock":
+            elif cmd == "lock":
                 lock = repo.lock()
                 respond("")
-            if cmd == "unlock":
+            elif cmd == "unlock":
                 if lock:
                     lock.release()
                 lock = None
@@ -2524,6 +2524,9 @@
                 r = repo.addchangegroup(fin, 'serve')
                 respond(str(r))
 
+            else:
+                respond("")
+
     optlist = ("name templates style address port ipv6"
                " accesslog errorlog webdir_conf")
     for o in optlist.split():