Skip to content

Conversation

@MarcelRobitaille
Copy link
Contributor

Headers are stored in a linked list so there is no limit to the number of additional headers

Basically the same as #19 but there is no limit to the amount of additional headers.

Headers are stored in a linked list so there is no limit to the number
of additional headers
}

void ArduinoHttpServer::AbstractStreamHttpReply::addHeader(const char* header) {
Header* h = new Header(header);
Copy link
Owner

Choose a reason for hiding this comment

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

I can understand you want this feature, but I want to steer clear from dynamic memory allocation for this library.
I am trying to move everything to FixString instead of using new/delete (I even rather would use smart pointers instead of new/delete (and even the C-style free)).

If you want to use a linked list I would advise not embedding it inside a class named Header, but instead make a container type class that can hold Header classes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I completely understand not wanting dynamic memory allocation. What do you think about using an #ifdef to let the user switch between this implementation and something like #19, with the default being static?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants