1. Benjamin Smith
  2. python-stomp

Commits

Benjamin Smith  committed 71a59dd

Fix to address #9 for blocking conditions. Also, raise UnknownBrokerResponseError instead of returning None. Otherwise you get an exception about 'NoneType' in the caller

  • Participants
  • Parent commits 3b7b530
  • Branches default

Comments (0)

Files changed (1)

File stompy/frame.py

View file
             while not buffer.endswith('\x00'):
                 try:
                     partial = self.sock.recv(1)
+                    if not partial or partial == '':
+                        raise UnknownBrokerResponseError('empty reply')
                 except socket.error, exc:
                     if exc[0] == EAGAIN or exc[0] == EWOULDBLOCK:
                         if not buffer or buffer == '\n':
-                            return None
+                            raise UnknownBrokerResponseError('empty reply')
                         continue
                 buffer += partial
         finally: