Skip to content

Code cleanup prior to queue replacement #50

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

Merged
merged 6 commits into from
Apr 21, 2025

Conversation

willmmiles
Copy link

This is the first part of a replacment series for #21, consisting of removing unsafe interfaces and some internal cleanup prior to the queue structure change.

  • Remove the intrusive list from AsyncClient
  • Remove the unsafe copy constructor from AsyncClient
  • Use a recursion-safe guard class over the LwIP mutex
  • Remove private callbacks from public headers
  • Strengthen client pointer typing in lwip_tcp_event_packet_t

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

@mathieucarbou
Copy link
Member

mathieucarbou commented Apr 16, 2025

@willmmiles : can you please rebase on main ? We had a standing PR that I have merged this morning to be able to work in esp-idf without Arudino. So there are now a little conflict to solve, sorry...

We should be able to merge this cleanup PR after because there is no design change (I quickly went through the code but will do it more deeply once rebased).

Thanks a lot for your work!

The previous code tried to implement move-as-copy semantics, which can
lead to unexpected behavior; and further it was not safe, as there was a
risk of race conditions with the LwIP thread.

Remove the unsafe function for now, and indicate to the compiler to
check for it.

If there's a strong need for a move operation in the future, the thread
safety can be reviewed at that time.
Use a recursion-safe guard class for managing the LwIP lock. This
will allow some improvements to reduce code duplication.
Use a friend class to ensure that private callbacks are not exposed to
client code.
@willmmiles willmmiles force-pushed the replace-queue-v2-part1 branch from be4f196 to d3e5501 Compare April 16, 2025 12:51
@mathieucarbou
Copy link
Member

@willmmiles : fyi @me-no-dev will be able to have a look today or Friday.
Looking towards issuing a new release friday or this week-end with all recently merged PRs.

@mathieucarbou mathieucarbou merged commit fba8799 into ESP32Async:main Apr 21, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants