Commit 55697ad7 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Catch KeyError in packet dispatching. Use BINARY rather than INT for checksum.

git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@39 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 596eeccb
...@@ -75,7 +75,7 @@ class EventHandler(object): ...@@ -75,7 +75,7 @@ class EventHandler(object):
method = self.packet_dispatch_table[t] method = self.packet_dispatch_table[t]
args = packet.decode() or () args = packet.decode() or ()
method(conn, packet, *args) method(conn, packet, *args)
except ValueError: except (KeyError, ValueError):
self.handleUnexpectedPacket(conn, packet) self.handleUnexpectedPacket(conn, packet)
except ProtocolError, m: except ProtocolError, m:
self.packetMalformed(conn, packet, m[1]) self.packetMalformed(conn, packet, m[1])
......
...@@ -89,7 +89,7 @@ class Application(object): ...@@ -89,7 +89,7 @@ class Application(object):
q("""CREATE TABLE IF NOT EXISTS obj ( q("""CREATE TABLE IF NOT EXISTS obj (
oid BINARY(8) NOT NULL, oid BINARY(8) NOT NULL,
serial BINARY(8) NOT NULL, serial BINARY(8) NOT NULL,
checksum INT UNSIGNED NOT NULL, checksum BINARY(4) NOT NULL,
compression TINYINT UNSIGNED NOT NULL, compression TINYINT UNSIGNED NOT NULL,
value MEDIUMBLOB NOT NULL, value MEDIUMBLOB NOT NULL,
PRIMARY KEY (oid, serial) PRIMARY KEY (oid, serial)
...@@ -108,7 +108,7 @@ class Application(object): ...@@ -108,7 +108,7 @@ class Application(object):
q("""CREATE TABLE IF NOT EXISTS tobj ( q("""CREATE TABLE IF NOT EXISTS tobj (
oid BINARY(8) NOT NULL, oid BINARY(8) NOT NULL,
serial BINARY(8) NOT NULL, serial BINARY(8) NOT NULL,
checksum INT UNSIGNED NOT NULL, checksum BINARY(4) NOT NULL,
compression TINYINT UNSIGNED NOT NULL, compression TINYINT UNSIGNED NOT NULL,
value MEDIUMBLOB NOT NULL value MEDIUMBLOB NOT NULL
) ENGINE = InnoDB""") ) ENGINE = InnoDB""")
......
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