-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Closed
Labels
Status: Awaiting triageIssue is waiting for triageIssue is waiting for triage
Description
Version
latest master (checkout manually)
Description
Lately there have been issues with handling multiple requests to the webserver shortly after eachother.
For example loading CSS as a separate call or handling a GET and then a POST or when authenticating using a script.
It appears _sse
is not always initialized in NetworkClient
:
arduino-esp32/libraries/Network/src/NetworkClient.cpp
Lines 184 to 189 in 6005b15
NetworkClient::NetworkClient() : _rxBuffer(nullptr), _connected(false), _sse(false), _timeout(WIFI_CLIENT_DEF_CONN_TIMEOUT_MS), next(NULL) {} | |
NetworkClient::NetworkClient(int fd) : _connected(true), _timeout(WIFI_CLIENT_DEF_CONN_TIMEOUT_MS), next(NULL) { | |
clientSocketHandle.reset(new NetworkClientSocketHandle(fd)); | |
_rxBuffer.reset(new NetworkClientRxBuffer(fd)); | |
} |
And the declaration of the members (without initialization):
arduino-esp32/libraries/Network/src/NetworkClient.h
Lines 36 to 44 in 6005b15
class NetworkClient : public ESPLwIPClient { | |
protected: | |
std::shared_ptr<NetworkClientSocketHandle> clientSocketHandle; | |
std::shared_ptr<NetworkClientRxBuffer> _rxBuffer; | |
bool _connected; | |
bool _sse; | |
int _timeout; | |
int _lastWriteTimeout; | |
int _lastReadTimeout; |
Suggested fix:
in NetworkClient.h:
class NetworkClient : public ESPLwIPClient {
protected:
std::shared_ptr<NetworkClientSocketHandle> clientSocketHandle = nullptr;
std::shared_ptr<NetworkClientRxBuffer> _rxBuffer = nullptr;
bool _connected = false;
bool _sse = false;
int _timeout;
int _lastWriteTimeout = 0;
int _lastReadTimeout = 0;
Not only _sse
is not always initialized, there are other members too.
I have checked existing issues, online documentation and the Troubleshooting Guide
- I confirm I have checked existing issues, online documentation and Troubleshooting guide.
Metadata
Metadata
Assignees
Labels
Status: Awaiting triageIssue is waiting for triageIssue is waiting for triage