-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
feat(webserver): Middleware with default middleware for cors, authc, curl-like logging #10750
Conversation
…curl-like logging
👋 Hello mathieucarbou, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
Note: I kept using chained pointers, I don't know why STL lists are not used across the code, if it is because Arduino Core has to support AVR-like boards where C++ STL is not available ? Because if it is the case, then why not creating a sort of |
Test Results 62 files 62 suites 5m 41s ⏱️ Results for commit f977d60. ♻️ This comment has been updated with latest results. |
It's been on my backlog to create something that is thread-safe, but so is a nice Task class... maybe we will find time in near future to do it. In order to have real impact and because the core is partially in C, it would be nice to have a C version that would be implemented in the CPP as well. Then we can go around and replace all lists with that |
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.
Click to expand the detailed deltas report [usage change in BYTES]
|
return true; | ||
} | ||
} | ||
assert(last); | ||
if (_collectAllHeaders) { | ||
last->next = new RequestArgument(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe replace default construction with non-default member initialization?
last->next = new RequestArgument{.key = headerName, .value = headerValue};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use consteval in arduino code ? removing it to your sample and switching to c++11 or 17 leads to a completely different output. So is it worth doing it ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use consteval in arduino code ?
consteval
introduce in c++20 -- if this standard is available, consteval
will be available.
but I gave that code as a demonstration that everything will be fine (even in constexpr context)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://godbolt.org/z/bxb99Weoh for c++11(14)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to say in general that instead of several operations, you can do all of them at once with one.
last->next = new RequestArgument();
last->next->key = headerName;
last->next->value = headerValue;
->
last->next = new RequestArgument{ headerName, headerValue };
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, completely agree!
For history, please see: #10186
This PR improves WebServer with the following additions: