-
Notifications
You must be signed in to change notification settings - Fork 3k
DNS manual cleanup mechanism added #11535
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
*/ | ||
|
||
#include "mbed.h" | ||
#include "nsapi_dns.h" | ||
|
||
#ifndef MULTIHOMING_TESTS_H | ||
#define MULTIHOMING_TESTS_H | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -228,6 +228,14 @@ nsapi_error_t nsapi_dns_query_async_cancel(nsapi_error_t id); | |
*/ | ||
void nsapi_dns_call_in_set(call_in_callback_cb_t callback); | ||
|
||
/** | ||
* @brief nsapi_dns_reset Resets all internal states and frees reserved memory, see NOTE! | ||
* Can be used to clean up system resources when there is no need for network connections. | ||
* NOTE: Does NOT clear asynchronous ongoing operations! | ||
* Currently only cleans up DNS cache (if used) | ||
*/ | ||
void nsapi_dns_reset(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this in the public API? I don't see any real use cases for resetting the cache, other than to test it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't have, but some application developer might want to use it so why should we prevent that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The real solution should be that when last NetworkStack is freed, we should free all DNS related stuff as well. Or if permanent DNS cache is needed, we could flag that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Such automatic purging should be optional. Cached information is still valid even if a network interface goes down. No objection to adding a public API for test and/or application use though. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Our DNS greentea tests use cache, even though perhaps sometimes they shouldn't. For example, if you run the whole suite, then the |
||
|
||
/** Add a domain name server to list of servers to query | ||
* | ||
* @param addr Destination for the host address | ||
|
Uh oh!
There was an error while loading. Please reload this page.