##// END OF EJS Templates
wireprotoserver: subclass the new `baseprotocolhandler` Protocol class
Matt Harbison -
r53018:1938d72e default
parent child Browse files
Show More
@@ -19,7 +19,6 from . import (
19 wireprototypes,
19 wireprototypes,
20 wireprotov1server,
20 wireprotov1server,
21 )
21 )
22 from .interfaces import util as interfaceutil
23 from .utils import (
22 from .utils import (
24 compression,
23 compression,
25 stringutil,
24 stringutil,
@@ -56,8 +55,7 def decodevaluefromheaders(req, headerpr
56 return b''.join(chunks)
55 return b''.join(chunks)
57
56
58
57
59 @interfaceutil.implementer(wireprototypes.baseprotocolhandler)
58 class httpv1protocolhandler(wireprototypes.baseprotocolhandler):
60 class httpv1protocolhandler:
61 def __init__(self, req, ui, checkperm):
59 def __init__(self, req, ui, checkperm):
62 self._req = req
60 self._req = req
63 self._ui = ui
61 self._ui = ui
@@ -65,7 +63,7 class httpv1protocolhandler:
65 self._protocaps = None
63 self._protocaps = None
66
64
67 @property
65 @property
68 def name(self):
66 def name(self) -> bytes:
69 return b'http-v1'
67 return b'http-v1'
70
68
71 def getargs(self, args):
69 def getargs(self, args):
@@ -375,8 +373,7 def _sshv1respondooberror(fout, ferr, rs
375 fout.flush()
373 fout.flush()
376
374
377
375
378 @interfaceutil.implementer(wireprototypes.baseprotocolhandler)
376 class sshv1protocolhandler(wireprototypes.baseprotocolhandler):
379 class sshv1protocolhandler:
380 """Handler for requests services via version 1 of SSH protocol."""
377 """Handler for requests services via version 1 of SSH protocol."""
381
378
382 def __init__(self, ui, fin, fout):
379 def __init__(self, ui, fin, fout):
@@ -386,7 +383,7 class sshv1protocolhandler:
386 self._protocaps = set()
383 self._protocaps = set()
387
384
388 @property
385 @property
389 def name(self):
386 def name(self) -> bytes:
390 return wireprototypes.SSHV1
387 return wireprototypes.SSHV1
391
388
392 def getargs(self, args):
389 def getargs(self, args):
General Comments 0
You need to be logged in to leave comments. Login now