Commit e3e6375e authored by Grégory Wisniewski's avatar Grégory Wisniewski

Rename _readString to _decodeString for consistency.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1955 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent e9a038e1
...@@ -199,7 +199,7 @@ def _encodeTID(tid): ...@@ -199,7 +199,7 @@ def _encodeTID(tid):
return INVALID_TID return INVALID_TID
return tid return tid
def _readString(buf, name, offset=0): def _decodeString(buf, name, offset=0):
buf = buf[offset:] buf = buf[offset:]
(size, ) = unpack('!L', buf[:4]) (size, ) = unpack('!L', buf[:4])
string = buf[4:4+size] string = buf[4:4+size]
...@@ -345,7 +345,7 @@ class RequestIdentification(Packet): ...@@ -345,7 +345,7 @@ class RequestIdentification(Packet):
r = unpack(self._header_format, body[:self._header_len]) r = unpack(self._header_format, body[:self._header_len])
major, minor, node_type, uuid, address = r major, minor, node_type, uuid, address = r
address = _decodeAddress(address) address = _decodeAddress(address)
(name, _) = _readString(body, 'name', offset=self._header_len) (name, _) = _decodeString(body, 'name', offset=self._header_len)
node_type = _decodeNodeType(node_type) node_type = _decodeNodeType(node_type)
uuid = _decodeUUID(uuid) uuid = _decodeUUID(uuid)
if (major, minor) != PROTOCOL_VERSION: if (major, minor) != PROTOCOL_VERSION:
...@@ -889,7 +889,7 @@ class AskStoreObject(Packet): ...@@ -889,7 +889,7 @@ class AskStoreObject(Packet):
r = unpack(self._header_format, body[:header_len]) r = unpack(self._header_format, body[:header_len])
oid, serial, tid, compression, checksum = r oid, serial, tid, compression, checksum = r
serial = _decodeTID(serial) serial = _decodeTID(serial)
(data, _) = _readString(body, 'data', offset=header_len) (data, _) = _decodeString(body, 'data', offset=header_len)
return (oid, serial, compression, checksum, data, tid) return (oid, serial, compression, checksum, data, tid)
class AnswerStoreObject(Packet): class AnswerStoreObject(Packet):
...@@ -1002,7 +1002,7 @@ class AnswerObject(Packet): ...@@ -1002,7 +1002,7 @@ class AnswerObject(Packet):
oid, serial_start, serial_end, compression, checksum = r oid, serial_start, serial_end, compression, checksum = r
if serial_end == INVALID_TID: if serial_end == INVALID_TID:
serial_end = None serial_end = None
(data, _) = _readString(body, 'data', offset=header_len) (data, _) = _decodeString(body, 'data', offset=header_len)
return (oid, serial_start, serial_end, compression, checksum, data) return (oid, serial_start, serial_end, compression, checksum, data)
class AskTIDs(Packet): class AskTIDs(Packet):
...@@ -1484,7 +1484,7 @@ class Error(Packet): ...@@ -1484,7 +1484,7 @@ class Error(Packet):
offset = self._header_len offset = self._header_len
(code, ) = unpack(self._header_format, body[:offset]) (code, ) = unpack(self._header_format, body[:offset])
code = _decodeErrorCode(code) code = _decodeErrorCode(code)
(message, _) = _readString(body, 'message', offset=offset) (message, _) = _decodeString(body, 'message', offset=offset)
return (code, message) return (code, message)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment