Removing dead code for RequestedConnectionType - #471
Merged
Conversation
mathieucarbou
force-pushed
the
RequestedConnectionType
branch
from
July 31, 2026 13:42
f94a27c to
097bfaf
Compare
- RCT_NOT_USED unused only as a placeholder as a default param value - RCT_DEFAULT was partly mean RCT_HTTP but was never assigned, so hardly usable from user code.
mathieucarbou
force-pushed
the
RequestedConnectionType
branch
from
July 31, 2026 13:47
74ef00e to
1c1a543
Compare
willmmiles
requested changes
Aug 2, 2026
mathieucarbou
force-pushed
the
RequestedConnectionType
branch
from
August 2, 2026 13:34
a3d3c15 to
edd16e7
Compare
There was a problem hiding this comment.
Pull request overview
This PR removes unused RequestedConnectionType enum values and related helper logic, simplifying how request connection type is represented and checked across the server request parsing and API surface.
Changes:
- Simplifies request header parsing logic to only treat
RCT_HTTPas the “plain HTTP” baseline for WS/SSE classification. - Removes unused
RequestedConnectionTypevalues and prunesrequestedConnTypeToString()accordingly. - Reworks
isExpectedRequestedConnType(...)into a single-type check with deprecated overloads for multi-argument compatibility.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/WebRequest.cpp |
Updates WS/SSE detection conditions and removes unused connection-type string/utility cases. |
src/literals.h |
Removes unused string literals for deleted enum values. |
src/ESPAsyncWebServer.h |
Removes unused enum members and refactors connection-type checking API. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
395
to
399
| typedef enum { | ||
| RCT_NOT_USED = -1, | ||
| RCT_DEFAULT = 0, | ||
| RCT_HTTP, | ||
| RCT_WS, | ||
| RCT_EVENT, | ||
| RCT_MAX | ||
| RCT_HTTP = 1, | ||
| RCT_WS = 2, | ||
| RCT_EVENT = 3 | ||
| } RequestedConnectionType; |
Member
Author
There was a problem hiding this comment.
yes this is intentional. They should not be used by the user code anyway.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/ESPAsyncWebServer.h:399
- Removing the public enum values
RCT_DEFAULT,RCT_NOT_USED, andRCT_MAXis a source-breaking change for downstream sketches/libraries that reference them. Consider keeping backward-compatible aliases (marked deprecated) for at least one release cycle so existing code still compiles while migrating toRCT_HTTP/ the 1-argisExpectedRequestedConnTypeoverloads.
typedef enum {
RCT_HTTP = 1,
RCT_WS = 2,
RCT_EVENT = 3
} RequestedConnectionType;
willmmiles
approved these changes
Aug 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.