[Zodb-checkins] CVS: ZODB3/ZEO/zrpc - smac.py:1.38.6.1
Tim Peters
tim.one at comcast.net
Mon Sep 15 19:22:00 EDT 2003
Update of /cvs-repository/ZODB3/ZEO/zrpc
In directory cvs.zope.org:/tmp/cvs-serv4968/ZEO/zrpc
Modified Files:
Tag: Zope-2_7-branch
smac.py
Log Message:
Change MAC_BIT to a long, to avoid deprecation warning from Python 2.3.
=== ZODB3/ZEO/zrpc/smac.py 1.38 => 1.38.6.1 ===
--- ZODB3/ZEO/zrpc/smac.py:1.38 Fri May 30 15:20:56 2003
+++ ZODB3/ZEO/zrpc/smac.py Mon Sep 15 19:21:59 2003
@@ -64,7 +64,7 @@
# that we could pass to send() without blocking.
SEND_SIZE = 60000
-MAC_BIT = 0x80000000
+MAC_BIT = 0x80000000L
class SizedMessageAsyncConnection(asyncore.dispatcher):
__super_init = asyncore.dispatcher.__init__
@@ -155,7 +155,7 @@
msg = inp[offset:offset + msg_size]
offset = offset + msg_size
if not state:
- msg_size = struct.unpack(">i", msg)[0]
+ msg_size = struct.unpack(">I", msg)[0]
expect_mac = msg_size & MAC_BIT
if expect_mac:
msg_size ^= MAC_BIT
@@ -256,11 +256,11 @@
try:
# do two separate appends to avoid copying the message string
if self.__hmac:
- self.__output.append(struct.pack(">i", len(message) | MAC_BIT))
+ self.__output.append(struct.pack(">I", len(message) | MAC_BIT))
self.__hmac.update(message)
self.__output.append(self.__hmac.digest())
else:
- self.__output.append(struct.pack(">i", len(message)))
+ self.__output.append(struct.pack(">I", len(message)))
if len(message) <= SEND_SIZE:
self.__output.append(message)
else:
More information about the Zodb-checkins
mailing list