##// END OF EJS Templates
wireprotov2peer: use our CBOR decoder...
Gregory Szorc -
r39481:9f51fd22 default
parent child Browse files
Show More
@@ -8,15 +8,15 b''
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 from .i18n import _
10 from .i18n import _
11 from .thirdparty import (
12 cbor,
13 )
14 from . import (
11 from . import (
15 encoding,
12 encoding,
16 error,
13 error,
17 util,
14 util,
18 wireprotoframing,
15 wireprotoframing,
19 )
16 )
17 from .utils import (
18 cborutil,
19 )
20
20
21 def formatrichmessage(atoms):
21 def formatrichmessage(atoms):
22 """Format an encoded message from the framing protocol."""
22 """Format an encoded message from the framing protocol."""
@@ -44,13 +44,10 b' class commandresponse(object):'
44
44
45 def cborobjects(self):
45 def cborobjects(self):
46 """Obtain decoded CBOR objects from this response."""
46 """Obtain decoded CBOR objects from this response."""
47 size = self.b.tell()
48 self.b.seek(0)
47 self.b.seek(0)
49
48
50 decoder = cbor.CBORDecoder(self.b)
49 for v in cborutil.decodeall(self.b.getvalue()):
51
50 yield v
52 while self.b.tell() < size:
53 yield decoder.decode()
54
51
55 class clienthandler(object):
52 class clienthandler(object):
56 """Object to handle higher-level client activities.
53 """Object to handle higher-level client activities.
General Comments 0
You need to be logged in to leave comments. Login now