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

[WebServer] ERR_CONNECTION_RESET on multiple requests #10736

Closed
1 task done
TD-er opened this issue Dec 16, 2024 · 0 comments · Fixed by #10737
Closed
1 task done

[WebServer] ERR_CONNECTION_RESET on multiple requests #10736

TD-er opened this issue Dec 16, 2024 · 0 comments · Fixed by #10737
Labels
Status: Awaiting triage Issue is waiting for triage

Comments

@TD-er
Copy link
Contributor

TD-er commented Dec 16, 2024

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:

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):

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting triage Issue is waiting for triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant