Skip to content

http_client free pbuf in callbacks#752

Open
anatol-newton wants to merge 1 commit into
raspberrypi:developfrom
anatol-newton:fix/http_client_free
Open

http_client free pbuf in callbacks#752
anatol-newton wants to merge 1 commit into
raspberrypi:developfrom
anatol-newton:fix/http_client_free

Conversation

@anatol-newton
Copy link
Copy Markdown

Free pbufs after they were used in multiple callbacks:
http_client_header_print_fn and http_client_receive_print_fn are example callbacks, that print the received data. The buffers should be freed afterwards, as they are not further used,

internal_header_fn is the internal function, that later calls a user callback. Only free the pbuf if no user callback is called. When a user callback is called, the freeing has to take place in there.

If the buffers are not freed, the MCU will eventually run out of RAM (in my application where I found the issue this occurred already after about twelve requests)

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.

1 participant