Check that the session is still alive before sending data.

Fixes issue #168
This commit is contained in:
Lance Stout 2012-06-01 13:50:38 -07:00
parent 2858dbf57f
commit 387ef513d6

View file

@ -1612,7 +1612,8 @@ class XMLStream(object):
tries = 0
try:
with self.send_lock:
while sent < total and not self.stop.is_set():
while sent < total and not self.stop.is_set() and
self.session_started_event.is_set():
try:
sent += self.socket.send(enc_data[sent:])
count += 1