Commit 3309bc3e authored by Tommy Olofsson's avatar Tommy Olofsson
Browse files

Print when sending as well.

parent 7df8c063
......@@ -378,6 +378,11 @@ class ExtCtrl(object):
while self.cookie == None:
self.cond.wait(1)
def send(self, data):
if self.packetdebug:
print "Sending", Packet(data)
self.ethernet.send(data)
def send_INIT(self):
flags = kind_INIT | flag_NEED_ACK
fragmenter = Fragmenter(destination=self.other,
......@@ -387,7 +392,7 @@ class ExtCtrl(object):
index=self.local_index)
for i in self.retries(self.local_index):
for f in fragmenter.fragments(max_length=self.max_length):
self.ethernet.send(f.getvalue())
self.send(f.getvalue())
self.next_index()
def send_INIT_ACK(self):
......@@ -399,7 +404,7 @@ class ExtCtrl(object):
index=self.remote_index)
fragmenter.encode_uint32(self.local_index)
for f in fragmenter.fragments(max_length=self.max_length):
self.ethernet.send(f.getvalue())
self.send(f.getvalue())
def send_ACK(self, packet):
flags = packet.kind | flag_IS_ACK
......@@ -409,7 +414,7 @@ class ExtCtrl(object):
cookie=packet.cookie,
index=packet.index)
for f in fragmenter.fragments(max_length=self.max_length):
self.ethernet.send(f.getvalue())
self.send(f.getvalue())
def send_DATA_with_ack(self, data):
flags = kind_DATA | flag_NEED_ACK
......@@ -421,7 +426,7 @@ class ExtCtrl(object):
fragmenter.write(data)
for i in self.retries(self.local_index):
for f in fragmenter.fragments(max_length=self.max_length):
self.ethernet.send(f.getvalue())
self.send(f.getvalue())
self.next_index()
def send_DATA(self, data):
......@@ -433,7 +438,7 @@ class ExtCtrl(object):
index=self.local_index)
fragmenter.write(data)
for f in fragmenter.fragments(max_length=self.max_length):
self.ethernet.send(f.getvalue())
self.send(f.getvalue())
self.next_index()
def writer(self):
......
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