File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -300,10 +300,15 @@ static void _tcp_error(void * arg, int8_t err) {
300
300
301
301
static void _tcp_dns_found (const char * name, struct ip_addr * ipaddr, void * arg) {
302
302
lwip_event_packet_t * e = (lwip_event_packet_t *)malloc (sizeof (lwip_event_packet_t ));
303
+ // ets_printf("+DNS: name=%s ipaddr=0x%08x arg=%x\n", name, ipaddr, arg);
303
304
e->event = LWIP_TCP_DNS;
304
305
e->arg = arg;
305
306
e->dns .name = name;
306
- memcpy (&e->dns .addr , ipaddr, sizeof (struct ip_addr ));
307
+ if (ipaddr) {
308
+ memcpy (&e->dns .addr , ipaddr, sizeof (struct ip_addr ));
309
+ } else {
310
+ memset (&e->dns .addr , 0 , sizeof (e->dns .addr ));
311
+ }
307
312
if (!_send_async_event (&e)) {
308
313
free ((void *)(e));
309
314
}
@@ -942,7 +947,7 @@ int8_t AsyncClient::_poll(tcp_pcb* pcb){
942
947
}
943
948
944
949
void AsyncClient::_dns_found (struct ip_addr *ipaddr){
945
- if (ipaddr){
950
+ if (ipaddr && ipaddr-> u_addr . ip4 . addr ){
946
951
connect (IPAddress (ipaddr->u_addr .ip4 .addr ), _connect_port);
947
952
} else {
948
953
if (_error_cb) {
You can’t perform that action at this time.
0 commit comments