Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

fix(http): remove redundant memory allocated for HTTP answering string #543

Closed
wants to merge 1 commit into from

Conversation

YingHan-Chen
Copy link
Contributor

@YingHan-Chen YingHan-Chen commented Apr 2, 2020

Set the MHD response mode to MHD_RESPMEM_PERSISTENT to indicate that buffer is a persistent (static/global) buffer that won't change for at least the lifetime of the response, MHD should just use it, not free it.

Close #519

Copy link
Contributor

@howjmay howjmay left a comment

Choose a reason for hiding this comment

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

Can you add more description about this PR?

Set the MHD response mode to MHD_RESPMEM_PERSISTENT to indicate that buffer is a persistent (static/global) buffer that won't change for at least the lifetime of the response, MHD should just use it, not free it.

Close DLTcollab#519
@YingHan-Chen
Copy link
Contributor Author

Can you add more description about this PR?

I add some in the commit message and PR description.

@jserv
Copy link
Member

jserv commented Apr 5, 2020

Amend git commit message. Please check How to Write a Git Commit Message:

Wrap the body at 72 characters

@YingHan-Chen
Copy link
Contributor Author

The regular response content buffer expects error cases must be allocated.
We need another method to prevent allocate memory to response buffer when out of memory.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Amend HTTP request answering strings
3 participants