]> git.michaelhowe.org Git - packages/p/paho-mqtt.git/commitdiff
[443881] Handle exceptions from select() in client loop() function.
authorRoger A. Light <roger@atchoo.org>
Sat, 13 Sep 2014 20:19:09 +0000 (21:19 +0100)
committerRoger A. Light <roger@atchoo.org>
Sat, 13 Sep 2014 20:19:09 +0000 (21:19 +0100)
Handle exceptions from select() in client loop() function. Closes #443881.
Thanks to Jeff Jasper.

Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=443881
Change-Id: I4bbee80554917b61a0d413dc490370391a6fe2b5

ChangeLog.txt
src/paho/mqtt/client.py

index 75d04c0ac355cfd4b4e44efc7a1ddf3d6bacc48d..9feab326a8fab2a92ad1cddb6f2b358d280839c4 100644 (file)
@@ -11,6 +11,8 @@ v1.0.2
 - Fix possible race condition when connecting with TLS and publishing at the
   same time, which could lead to PUBLISH data being sent before any other
   messages and unencrypted. Closes #443964. Thanks to Hiram van Paassen.
+- Handle exceptions from select() in client loop() function. Closes #443881.
+  Thanks to Jeff Jasper.
 
 
 v1.0.1
index 264f782f1c883696c98be4e158d7a0f329bf3412..a817f783ed9c82dc0cdd3b1df784dbb3dc8e68cf 100755 (executable)
@@ -802,6 +802,12 @@ class Client(object):
         except TypeError:
             # Socket isn't correct type, in likelihood connection is lost
             return MQTT_ERR_CONN_LOST
+        except ValueError:
+            # Can occur if we just reconnected but rlist/wlist contain a -1 for
+            # some reason.
+            return MQTT_ERR_CONN_LOST
+        except:
+            return MQTT_ERR_UNKNOWN
 
         if self.socket() in socklist[0]:
             rc = self.loop_read(max_packets)