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

WebServer: Use client() instead of _currentClient #11945

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

Draft
hurricanefrog wants to merge 1 commit into espressif:master
base: master
Choose a base branch
Loading
from hurricanefrog:issue/11944-derivable-webserver

Conversation

@hurricanefrog
Copy link

@hurricanefrog hurricanefrog commented Oct 24, 2025

This makes it possible to create derived classes properly.

Description of Change

This change replaces all uses of _currentClient in the WebServer class by calling the virtual method client().
(Except in handleClient, which makes to sense to touch, I think).

This makes it possible to create derived classes, e.g to create TLS-protected web servers.
This was not possible previously due to the hardcoded "plain" _currentClient.

Derived classes can now simply override client(), e.g. to return the TLS protected socket, and continue using the rest of the class (i.e. all of the HTTP parsing).

Test Scenarios

I haven't done any tests. I expect no impact on the function of the code. I haven't been able to create a HTTPS server with the changes yet, to confirm it leads to my goal, this takes some additional time.

Related links

closes #11944

@hurricanefrog hurricanefrog requested a review from a team as a code owner October 24, 2025 08:06
Copy link

CLAassistant commented Oct 24, 2025
edited
Loading

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

github-actions bot commented Oct 24, 2025
edited
Loading

Messages
📖 🎉 Good Job! All checks are passing!

👋 Hello hurricanefrog, we appreciate your contribution to this project!


📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project.

Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against c80e972

@hurricanefrog hurricanefrog force-pushed the issue/11944-derivable-webserver branch from 8cf7d81 to aa8c053 Compare October 24, 2025 08:09
Copy link
Author

Should I really lowercase the WebServer component to fix(webserver) in the commit message?

Copy link
Member

Should I really lowercase the WebServer component to fix(webserver) in the commit message?

It's not a big deal, but it's nice to have consistency. Will not influence wether this gets merged or or not :)

this makes it possible to create derived classes properly.
@hurricanefrog hurricanefrog force-pushed the issue/11944-derivable-webserver branch from aa8c053 to c80e972 Compare October 24, 2025 08:27
Copy link
Member

I haven't done any tests. I expect no impact on the function of the code. I haven't been able to create a HTTPS server with the changes yet, to confirm it leads to my goal, this takes some additional time.

Lets keep this open then (I'll convert it to Draft) until you can test it, in case other changes also need to be added. Please let us know when you have done that :)

hurricanefrog reacted with thumbs up emoji

@me-no-dev me-no-dev marked this pull request as draft October 24, 2025 08:28
Copy link
Contributor

Test Results

76 files 76 suites 15m 57s ⏱️
38 tests 38 ✅ 0 💤 0 ❌
241 runs 241 ✅ 0 💤 0 ❌

Results for commit c80e972.

Copy link
Contributor

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32C50⚠️ +600.00⚠️ +0.01000.000.00
ESP32P40⚠️ +600.00⚠️ +0.01000.000.00
ESP32S30⚠️ +240.000.00000.000.00
ESP32S20⚠️ +200.000.00000.000.00
ESP32C30⚠️ +640.00⚠️ +0.01000.000.00
ESP32C60⚠️ +600.00⚠️ +0.01000.000.00
ESP320⚠️ +320.000.00000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32C5ESP32P4ESP32S3ESP32S2ESP32C3ESP32C6ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
libraries/DNSServer/examples/CaptivePortal⚠️ +560⚠️ +560⚠️ +120⚠️ +160⚠️ +560⚠️ +560⚠️ +120
libraries/HTTPUpdateServer/examples/WebUpdater⚠️ +600⚠️ +600⚠️ +240⚠️ +160⚠️ +600⚠️ +600⚠️ +160
libraries/Update/examples/HTTP_Server_AES_OTA_Update⚠️ +600⚠️ +600⚠️ +160⚠️ +160⚠️ +600⚠️ +600⚠️ +160
libraries/Update/examples/OTAWebUpdater⚠️ +600⚠️ +600⚠️ +160⚠️ +160⚠️ +600⚠️ +600⚠️ +160
libraries/WebServer/examples/AdvancedWebServer⚠️ +560⚠️ +560⚠️ +120⚠️ +120⚠️ +560⚠️ +560⚠️ +120
libraries/WebServer/examples/ChunkWriting⚠️ +600⚠️ +600⚠️ +160⚠️ +160⚠️ +640⚠️ +600⚠️ +320
libraries/WebServer/examples/FSBrowser⚠️ +560⚠️ +560⚠️ +120⚠️ +120⚠️ +560⚠️ +560⚠️ +120
libraries/WebServer/examples/Filters⚠️ +560⚠️ +560⚠️ +120⚠️ +120⚠️ +560⚠️ +560⚠️ +160
libraries/WebServer/examples/HelloServer⚠️ +560⚠️ +560⚠️ +120⚠️ +120⚠️ +560⚠️ +560⚠️ +120
libraries/WebServer/examples/HttpAdvancedAuth⚠️ +560⚠️ +560⚠️ +120⚠️ +120⚠️ +560⚠️ +560⚠️ +120
libraries/WebServer/examples/HttpAuthCallback⚠️ +560⚠️ +560⚠️ +120⚠️ +120⚠️ +560⚠️ +560⚠️ +120
libraries/WebServer/examples/HttpAuthCallbackInline⚠️ +560⚠️ +560⚠️ +120⚠️ +120⚠️ +560⚠️ +560⚠️ +160
libraries/WebServer/examples/HttpBasicAuth⚠️ +560⚠️ +560⚠️ +120⚠️ +120⚠️ +560⚠️ +560⚠️ +120
libraries/WebServer/examples/HttpBasicAuthSHA1⚠️ +560⚠️ +560⚠️ +120⚠️ +160⚠️ +560⚠️ +560⚠️ +120
libraries/WebServer/examples/HttpBasicAuthSHA1orBearerToken⚠️ +560⚠️ +560⚠️ +120⚠️ +200⚠️ +560⚠️ +560⚠️ +120
libraries/WebServer/examples/Middleware⚠️ +560--⚠️ +120⚠️ +120⚠️ +560⚠️ +560⚠️ +120
libraries/WebServer/examples/MultiHomedServers⚠️ +560⚠️ +560⚠️ +120⚠️ +120⚠️ +560⚠️ +560⚠️ +120
libraries/WebServer/examples/PathArgServer⚠️ +560⚠️ +560⚠️ +120⚠️ +160⚠️ +560⚠️ +560⚠️ +120
libraries/WebServer/examples/SDWebServer⚠️ +560⚠️ +560⚠️ +160⚠️ +120⚠️ +560⚠️ +560⚠️ +120
libraries/WebServer/examples/SimpleAuthentification⚠️ +560⚠️ +56000⚠️ +160⚠️ +560⚠️ +560⚠️ +120
libraries/WebServer/examples/UploadHugeFile⚠️ +560⚠️ +560⚠️ +120⚠️ +120⚠️ +560⚠️ +560⚠️ +200
libraries/WebServer/examples/WebServer⚠️ +600⚠️ +600⚠️ +120⚠️ +120⚠️ +600⚠️ +600⚠️ +120
libraries/WebServer/examples/WebUpdate⚠️ +560⚠️ +560⚠️ +120⚠️ +120⚠️ +560⚠️ +560⚠️ +120

Sign up for free to 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.

WebServer: Make it possible to create and use derived classes

AltStyle によって変換されたページ (->オリジナル) /