##// END OF EJS Templates
protocol: command must be checked before passing in
Dirkjan Ochtman -
r11618:83070a9c default
parent child Browse files
Show More
@@ -67,5 +67,5 b' def iscmd(cmd):'
67 67
68 68 def call(repo, req, cmd):
69 69 p = webproto(req)
70 r = wireproto.dispatch(repo, p, cmd)
70 wireproto.dispatch(repo, p, cmd)
71 71 yield p.response
@@ -93,7 +93,9 b' class sshserver(object):'
93 93
94 94 def serve_one(self):
95 95 cmd = self.fin.readline()[:-1]
96 if cmd and not wireproto.dispatch(self.repo, self, cmd):
96 if cmd and cmd in wireproto.commands:
97 wireproto.dispatch(self.repo, self, cmd)
98 elif cmd:
97 99 impl = getattr(self, 'do_' + cmd, None)
98 100 if impl:
99 101 r = impl()
@@ -134,14 +134,11 b' class wirerepository(repo.repository):'
134 134 # server side
135 135
136 136 def dispatch(repo, proto, command):
137 if command not in commands:
138 return False
139 137 func, spec = commands[command]
140 138 args = proto.getargs(spec)
141 139 r = func(repo, proto, *args)
142 140 if r != None:
143 141 proto.respond(r)
144 return True
145 142
146 143 def between(repo, proto, pairs):
147 144 pairs = [decodelist(p, '-') for p in pairs.split(" ")]
General Comments 0
You need to be logged in to leave comments. Login now