Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix socket receive issues related to message buffer size #55

Merged
merged 1 commit into from
Jan 22, 2021

Commits on Jan 14, 2021

  1. Fix socket receive issues related to message buffer size

    This change addresses a few issues in the handling of the MQTT
    messages that caused the library to become unstable:
    
    - Add wrapper for socket.recv() so that an exact number of bytes
      are read into the buffer before attempting to parse the MQTT
      message;
    
    - Fix handling of ping response packets via _wait_for_msg();
    
    - Fix disconnect so it can gracefully handle cases when socket writes
      are not possible. Also re-init _subscribed_topics as an empty list
      instead of None.
    
    Related-to adafruit/Adafruit_CircuitPython_ESP32SPI#102
    Fixes adafruit/Adafruit_CircuitPython_PyPortal#98
    Fixes adafruit#54
    Signed-off-by: Flavio Fernandes <[email protected]>
    flavio-fernandes committed Jan 14, 2021
    Configuration menu
    Copy the full SHA
    3e5a14d View commit details
    Browse the repository at this point in the history