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 2022/06/26 01:45:38 UTC

[GitHub] [incubator-nuttx-apps] normanr commented on a diff in pull request #904: netutils/dhcpc: add non-blocking interface

normanr commented on code in PR #904:
URL: https://github.com/apache/incubator-nuttx-apps/pull/904#discussion_r906743256


##########
netutils/dhcpc/dhcpc.c:
##########
@@ -445,6 +448,47 @@ static uint8_t dhcpc_parsemsg(FAR struct dhcpc_state_s *pdhcpc, int buflen,
   return 0;
 }
 
+/****************************************************************************
+ * Name: dhcpc_run
+ ****************************************************************************/
+
+static void *dhcpc_run(void *args)
+{
+  FAR struct dhcpc_state_s *pdhcpc = (FAR struct dhcpc_state_s *)args;
+  struct dhcpc_state result;
+  int ret;
+
+  while (1)
+    {
+      ret = dhcpc_request(pdhcpc, &result);
+      if (ret == OK)
+        {
+          pdhcpc->callback(&result);
+        }
+      else
+        {
+          pdhcpc->callback(NULL);
+          nerr("dhcpc_request error\n");
+        }
+
+      if (pdhcpc->cancel)
+        {
+          return NULL;
+        }
+
+      while (result.lease_time)
+        {
+          result.lease_time = sleep(result.lease_time);

Review Comment:
   fixed in: https://github.com/apache/incubator-nuttx-apps/pull/958



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

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

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