Repository navigation
Fix W5100S socket exhaustion blocking MQTT and additional TCP clients #9770
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
Changes from 2 commits
a61a906
cfa167e
d74add6
c0805d0
b4afdbf
84f55c1
0fe55cc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -663,7 +663,11 @@ bool MQTT::isValidConfig(const meshtastic_ModuleConfig_MQTTConfig &config, MQTTC | |
| } | ||
| std::unique_ptr<PubSubClient> pubSub(new PubSubClient); | ||
| if (isConnectedToNetwork()) { | ||
| return connectPubSub(parsed, *pubSub, (client != nullptr) ? *client : *clientConnection); | ||
| bool result = connectPubSub(parsed, *pubSub, (client != nullptr) ? *client : *clientConnection); | ||
| if (client == nullptr) { | ||
| pubSub->disconnect(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Socket cleanup is conditional on client == nullptr; when a non-null client is passed, successful validation can still leave the connection open. Since this function is a validator, that side effect can leak scarce sockets on Ethernet-class devices. Consider ensuring cleanup for all validation paths (or explicitly documenting and renaming if persistent connection is intended). |
||
| } | ||
| return result; | ||
| } | ||
| #else | ||
| const char *warning = "Invalid MQTT config: proxy_to_client_enabled must be enabled on nodes that do not have a network"; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.