Commit 33fab6e3 authored by Levin Zimmermann's avatar Levin Zimmermann

Revert "proto: Switch 'compress' type on the wire from Optional[int] to bool"

This reverts commit 93f25df5.
parent 93f25df5
......@@ -506,7 +506,7 @@ class Application(ThreadedApplication):
checksum = makeChecksum(compressed_data)
txn_context.data_size += size
# Store object in tmp cache
packet = Packets.AskStoreObject(oid, serial, bool(compression),
packet = Packets.AskStoreObject(oid, serial, compression,
checksum, compressed_data, data_serial, ttid)
txn_context.data_dict[oid] = data, serial, txn_context.write(
self, packet, oid, oid=oid, serial=serial)
......
......@@ -619,7 +619,7 @@ class ImporterDatabaseManager(DatabaseManager):
if next_serial:
next_serial = p64(next_serial)
return (serial, next_serial,
False, checksum, value, zodb.getDataTid(z_oid, u_tid))
0, checksum, value, zodb.getDataTid(z_oid, u_tid))
def getTransaction(self, tid, all=False):
u64 = util.u64
......
......@@ -474,7 +474,7 @@ class DatabaseManager(object):
6-tuple: Record content.
- record serial (packed)
- serial or next record modifying object (packed, None)
- compression (boolean)
- compression (boolean-ish, None)
- checksum (binary string, None)
- data (binary string, None)
- data_serial (packed, None)
......@@ -489,7 +489,7 @@ class DatabaseManager(object):
return (tid or before_tid) and self.getLastObjectTID(oid) and False
return (util.p64(serial),
None if next_serial is None else util.p64(next_serial),
bool(compression), checksum, data,
compression, checksum, data,
None if data_serial is None else util.p64(data_serial))
@fallback
......@@ -511,7 +511,7 @@ class DatabaseManager(object):
r = self._fetchObject(u64(oid), u64(tid))
if r:
serial, compression, checksum, data, data_serial = r
return (util.p64(serial), bool(compression), checksum, data,
return (util.p64(serial), compression, checksum, data,
None if data_serial is None else util.p64(data_serial))
@requires(_getPartitionTable)
......
......@@ -114,6 +114,8 @@ class ClientOperationHandler(BaseHandler):
def askStoreObject(self, conn, oid, serial,
compression, checksum, data, data_serial, ttid):
if 1 < compression:
raise ProtocolError('invalid compression value')
# register the transaction
self.app.tm.register(conn, ttid)
if data or checksum != ZERO_HASH:
......
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