Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

WIP: Prevent crash on WebSocket request to non-WebSocket node.#106

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
MauAbata wants to merge1 commit intofhessel:master
base:master
Choose a base branch
Loading
fromMauAbata:bugfix/ws-upgrade-no-ws-route

Conversation

MauAbata
Copy link

This provides a partial fix for#51 to prevent the Guru from having to meditate. It's been tested on ESP32.

This now checks the HTTPNode type if a WebSocket was requested and only proceeds if the node is in fact a WebSocket, thus preventing thenewHandler() call from failing on normal HTTP nodes.

TODO

Right now I'm callingraiseError(404... because that was the first copypaste I can find. I'm not actually sure the best way to reject the websocket connection as I'm not familiar with this library (just picked it up yesterday). This code is sufficient to move the crash over to the client side, which reports a bad frame header now.

A proper rejection should be sent, however that is accomplished in WebSocket land.

Testing

  1. Clone and run the WebSocket chat server example from the master branch, and usehttps://www.websocket.org/echo.html to connect to the root URL on the device. This should panic and reset your ESP32. Connecting to/chat should work as expected.

  2. Check out this PR and do the same. The ESP32 should no longer panic, and report the rejection of non-WebSocket request.

gb-123-git added a commit to gb-123-git/esp32_https_server that referenced this pull requestJan 23, 2022
Prevent crash on WebSocket request to non-WebSocket node.fhessel#106
gb-123-git added a commit to gb-123-git/esp32_https_server that referenced this pull requestJan 23, 2022
WIP: Prevent crash on WebSocket request to non-WebSocket node.fhessel#106
khoih-prog added a commit to khoih-prog/ESP32_HTTPS_Server that referenced this pull requestSep 27, 2022
Merge some upstream PRs- Handling of errors - like unstable network - coming via SSLfhessel#89- WIP: Prevent crash on WebSocket request to non-WebSocket node.fhessel#106- Fix infinite loop when the buffer ends with \rfhessel#123- Fixed memory leak in the Websocket examplefhessel#157
This was referencedSep 27, 2022
khoih-prog added a commit to khoih-prog/ESP32_HTTPS_Server that referenced this pull requestSep 27, 2022
1. Merge some upstream PRs- Handling of errors - like unstable network - coming via SSLfhessel#89- WIP: Prevent crash on WebSocket request to non-WebSocket node.fhessel#106- Fix infinite loop when the buffer ends with \rfhessel#123- Fixed memory leak in the Websocket examplefhessel#1572. Update examples and `README.md`
khoih-prog added a commit to khoih-prog/ESP32_HTTPS_Server that referenced this pull requestSep 27, 2022
1. Merge some upstream PRs- Handling of errors - like unstable network - coming via SSLfhessel#89- WIP: Prevent crash on WebSocket request to non-WebSocket node.fhessel#106- Fix infinite loop when the buffer ends with \rfhessel#123- Fixed memory leak in the Websocket examplefhessel#1572. Update examples and `README.md`
khoih-prog added a commit to khoih-prog/ESP32_HTTPS_Server that referenced this pull requestSep 27, 2022
1. Merge some upstream PRs- Handling of errors - like unstable network - coming via SSLfhessel#89- WIP: Prevent crash on WebSocket request to non-WebSocket node.fhessel#106- Fix infinite loop when the buffer ends with \rfhessel#123- Fixed memory leak in the Websocket examplefhessel#1572. Update examples and `README.md`
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@MauAbata

[8]ページ先頭

©2009-2025 Movatter.jp