Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

made sasl frames the proper type

  • Loading branch information...
commit ce5e5e881fe0ec1f12215be1257a44b7c60b73d7 1 parent ba16d3f
@rhs authored
Showing with 9 additions and 5 deletions.
  1. +2 −1  connection.py
  2. +3 −2 dispatcher.py
  3. +2 −1  framing.py
  4. +2 −1  sasl.py
View
3  connection.py
@@ -18,6 +18,7 @@
#
from dispatcher import Dispatcher
+from framing import AMQP_FRAME
from protocol import *
from uuid import uuid4
@@ -31,7 +32,7 @@ class Connection(Dispatcher):
type_encoder = PROTOCOL_ENCODER
def __init__(self, factory):
- Dispatcher.__init__(self, 0)
+ Dispatcher.__init__(self, 0, AMQP_FRAME)
self.factory = factory
self.open_rcvd = False
View
5 dispatcher.py
@@ -29,8 +29,9 @@
class Dispatcher:
- def __init__(self, protocol_id):
+ def __init__(self, protocol_id, frame_type):
self.protocol_id = protocol_id
+ self.frame_type = frame_type
self.id = "%X" % id(self)
self._tracing = set()
self.tracing(*os.environ.get("AMQP_TRACE", "").split())
@@ -91,7 +92,7 @@ def process_frame(self, f):
def post_frame(self, channel, body):
self.trace("frm", "SENT[%s]: %s", channel, body.format(self.multiline))
- f = Frame(AMQP_FRAME, channel, None, self.type_encoder.encode(body))
+ f = Frame(self.frame_type, channel, None, self.type_encoder.encode(body))
self.output.write(encode(f))
def read(self, n=None):
View
3  framing.py
@@ -20,7 +20,8 @@
import struct
from util import Buffer, parse
-AMQP_FRAME = 0
+AMQP_FRAME = 0x00
+SASL_FRAME = 0x01
FRAME_HDR_FMT = "!I2BH"
FRAME_HDR_SIZE = struct.calcsize(FRAME_HDR_FMT)
assert FRAME_HDR_SIZE == 8
View
3  sasl.py
@@ -18,6 +18,7 @@
#
from dispatcher import Dispatcher
+from framing import SASL_FRAME
from protocol import *
@@ -27,7 +28,7 @@ class SASL(Dispatcher):
type_encoder = PROTOCOL_ENCODER
def __init__(self, connection):
- Dispatcher.__init__(self, 3)
+ Dispatcher.__init__(self, 3, SASL_FRAME)
self.connection = connection
self.mechanisms = None
self.mechanism = None
Please sign in to comment.
Something went wrong with that request. Please try again.