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/10 13:40:40 UTC

[GitHub] [incubator-nuttx] anchao opened a new pull request #3893: libs/libc/netdb: add dns clear interface

anchao opened a new pull request #3893:
URL: https://github.com/apache/incubator-nuttx/pull/3893


   ## Summary
   
   libs/libc/netdb: add dns clear interface 
   
   ## Impact
   
   The DNS cache should be cleared if a new server is added.
   
   ## Testing
   
   dns add server/dns cache expiration


-- 
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



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

Posted by GitBox <gi...@apache.org>.
yamt commented on a change in pull request #3893:
URL: https://github.com/apache/incubator-nuttx/pull/3893#discussion_r649690099



##########
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:
       this memset seems redundant.




-- 
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



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

Posted by GitBox <gi...@apache.org>.
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



[GitHub] [incubator-nuttx] xiaoxiang781216 merged pull request #3893: libs/libc/netdb: add dns clear interface

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged pull request #3893:
URL: https://github.com/apache/incubator-nuttx/pull/3893


   


-- 
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