Skip to content

fix(websocket): fix setup logic in the external transport (IDFGH-15250) #811

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

huming2207
Copy link
Contributor

@huming2207 huming2207 commented May 7, 2025

Description

Hi all,

I made a dumb mistake when I was submitting the PR: #573

I somehow forgot two branch logic when setting up the websocket client transport. These two logic exist in our company's codebase and we have used it for a year already, but somehow was missing in the PR to this upstream codebase. Without these two conditions, the websocket client will create a esp_transport handle anyhow, no matter the ext_transport was provided or not. This will break the proxy support of course.

Anyway, here's the fix. Sorry again for the trouble I made.

Regards,
Jackson

Related

PR related:

Testing

These two logic exist in our company's codebase and we have used it for a year already in our products.

Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

@huming2207 huming2207 marked this pull request as draft May 7, 2025 00:34
@huming2207
Copy link
Contributor Author

Sorry, we internally reviewed and we think we have more issues to fix. I will fix it first and then let you know we are ready.

@github-actions github-actions bot changed the title fix(websocket): add missing logics on setting up external transport fix(websocket): add missing logics on setting up external transport (IDFGH-15250) May 7, 2025
@espressif-bot espressif-bot added the Status: Opened Issue is new label May 7, 2025
@huming2207 huming2207 marked this pull request as ready for review May 7, 2025 02:50
@huming2207
Copy link
Contributor Author

Okay now I'm ready for review.

This also fixes some potential memory corruptions. Previously if I use an externally created proxy handle that is not a transport_ssl or transport_tcp handle, and if some options like keep alive was set, the esp_transport_ssl_set_*() will be called and eventually corrupts the proxy handle context. Because the type is different.

@huming2207 huming2207 changed the title fix(websocket): add missing logics on setting up external transport (IDFGH-15250) fix(websocket): fix setup logic in the external transport (IDFGH-15250) May 7, 2025
@huming2207
Copy link
Contributor Author

Hello @glmfe , may I ask is there any feedback on this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants