You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/06/14 07:17:53 UTC

[GitHub] [incubator-nuttx] anchao commented on a change in pull request #3893: libs/libc/netdb: add dns clear interface

anchao commented on a change in pull request #3893:
URL: https://github.com/apache/incubator-nuttx/pull/3893#discussion_r649724351



##########
File path: libs/libc/netdb/lib_dnscache.c
##########
@@ -164,6 +164,33 @@ void dns_save_answer(FAR const char *hostname,
   dns_semgive();
 }
 
+/****************************************************************************
+ * Name: dns_clear_answer
+ *
+ * Description:
+ *   Clear the resolved hostname in the DNS cache
+ *
+ * Returned Value:
+ *   None
+ *
+ ****************************************************************************/
+
+void dns_clear_answer(void)
+{
+  /* Get exclusive access to the DNS cache */
+
+  dns_semtake();
+
+  /* Clear the answer in the cache */
+
+  memset(g_dns_cache, 0, sizeof(g_dns_cache));

Review comment:
       Done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org