Imroy / pubsubclient

A client library for the ESP8266 that provides support for MQTT
MIT License
434 stars 115 forks source link

unsubscribe bug fix #38

Closed mtnbrit closed 8 years ago

mtnbrit commented 8 years ago

Hi in the src/MQTT.cpp file you are distributing with your pubsubclient, there are two errors around line 646

// Unsubscribe class
  Unsubscribe::Unsubscribe() :
    Message(SUBSCRIBE),
    _buffer(NULL), _buflen(0)
  {
    _need_packet_id = true;
  }

  Unsubscribe::Unsubscribe(String topic) :
    Message(SUBSCRIBE),
    _buffer(NULL), _buflen(0)
  {

the two instances of Message(SUBSCRIBE) should clearly be Message(UNSUBSCRIBE)

Ive run into this and fixing it makes unsubbing work,thx.

Imroy commented 8 years ago

Thanks for spotting that!