[Zope3-checkins] CVS: Zope3/src/zodb/zeo/zrpc - smac.py:1.7
Jeremy Hylton
jeremy@zope.com
Mon, 30 Jun 2003 17:26:45 -0400
Update of /cvs-repository/Zope3/src/zodb/zeo/zrpc
In directory cvs.zope.org:/tmp/cvs-serv4317
Modified Files:
smac.py
Log Message:
Add capital letters to squelch warning about large hex constant.
=== Zope3/src/zodb/zeo/zrpc/smac.py 1.6 => 1.7 ===
--- Zope3/src/zodb/zeo/zrpc/smac.py:1.6 Thu Jun 26 19:00:51 2003
+++ Zope3/src/zodb/zeo/zrpc/smac.py Mon Jun 30 17:26:44 2003
@@ -32,6 +32,7 @@
import socket
import struct
import threading
+import warnings
from zodb.zeo.zrpc.interfaces import DisconnectedError
from zodb.zeo.zrpc import log
@@ -58,7 +59,7 @@
# that we could pass to send() without blocking.
SEND_SIZE = 60000
-MAC_BIT = 0x80000000
+MAC_BIT = 0x80000000L
class SizedMessageAsyncConnection(asyncore.dispatcher, object):
__super_init = asyncore.dispatcher.__init__
@@ -149,7 +150,7 @@
offset = offset + msg_size
if not state:
# waiting for message
- 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
@@ -248,11 +249,11 @@
try:
# do 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: