Giter VIP home page Giter VIP logo

Comments (3)

256dpi avatar 256dpi commented on May 25, 2024 1

Thanks for testing. I had some time today and published v0.4.4 with the fix.

from esp-mqtt.

256dpi avatar 256dpi commented on May 25, 2024

Thanks for the report! As I'm on holidays I won't be able to do any tests myself until next week. But, I think I know where the crash is coming from. I realized that the disconnect is not properly cleaning up resources. While that is usually not a problem and LWIP is doing that for us, in your case where the whole stack gets reinitialized this will cause crashes.

The function around line https://github.com/256dpi/esp-mqtt/blob/master/esp_lwmqtt.c#L52 should probably be like that:

void esp_lwmqtt_network_disconnect(esp_lwmqtt_network_t *network) {
  // immediately return if conn is not set
  if (network->conn == NULL) {
    return;
  }

  // delete connection
  netconn_delete(network->conn);

  // reset network
  network->conn = NULL;
  network->rest_buf = NULL;
  network->rest_len = 0;
}

If you have time, you could test my hunch, otherwise I will conduct some tests myself next week.

from esp-mqtt.

pantaluna avatar pantaluna commented on May 25, 2024

Your suggested code change fixes the problem. I assume you update the master branch after the holidays. Thanks!

from esp-mqtt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.