Example of HTTPServer with additional features: * SNTPClient, DST rules * Link status indication * Local or SDCard-based WebServer * RPC-able class * Static and Dynamic HTML page

Dependencies:   mbed

Revision:
1:ec4170739967
Parent:
0:886e4b3119ad
--- a/lwip/Core/contrib/apps/sntp/sntp.c	Sun Jan 03 07:00:43 2010 +0000
+++ b/lwip/Core/contrib/apps/sntp/sntp.c	Fri Jan 08 00:28:14 2010 +0000
@@ -599,6 +599,7 @@
     sntp_initialize_request(sntpmsg);
     /* send request */
     udp_sendto(sntp_pcb, p, server_addr, SNTP_PORT);
+pbuf_free(p);    // [iva2k] fixing memory leak
     /* set up receive timeout: try next server or retry on timeout */
     sys_timeout((u32_t)SNTP_RECV_TIMEOUT, sntp_try_next_server, NULL);
 #if SNTP_CHECK_RESPONSE >= 1
@@ -629,7 +630,9 @@
   } else {
     /* DNS resolving failed -> try another server */
     LWIP_DEBUGF(SNTP_DEBUG_WARN_STATE, ("sntp_dns_found: Failed to resolve server address resolved, trying next server\n"));
-    sntp_try_next_server(NULL);
+//    sntp_try_next_server(NULL);
+// [iva2k] changing to delayed - having no DNS may mean that there is something wrong. don't hang in here.
+    sys_timeout((u32_t)SNTP_RECV_TIMEOUT, sntp_try_next_server, NULL);
   }
 }