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 @@ -298,10 +298,15 @@ static void _tcp_error(void * arg, int8_t err) {
298
298
299
299
static void _tcp_dns_found (const char * name, struct ip_addr * ipaddr, void * arg) {
300
300
lwip_event_packet_t * e = (lwip_event_packet_t *)malloc (sizeof (lwip_event_packet_t ));
301
+ // ets_printf("+DNS: name=%s ipaddr=0x%08x arg=%x\n", name, ipaddr, arg);
301
302
e->event = LWIP_TCP_DNS;
302
303
e->arg = arg;
303
304
e->dns .name = name;
304
- memcpy (&e->dns .addr , ipaddr, sizeof (struct ip_addr ));
305
+ if (ipaddr) {
306
+ memcpy (&e->dns .addr , ipaddr, sizeof (struct ip_addr ));
307
+ } else {
308
+ memset (&e->dns .addr , 0 , sizeof (e->dns .addr ));
309
+ }
305
310
if (!_send_async_event (&e)) {
306
311
free ((void *)(e));
307
312
}
@@ -923,7 +928,7 @@ int8_t AsyncClient::_poll(tcp_pcb* pcb){
923
928
}
924
929
925
930
void AsyncClient::_dns_found (struct ip_addr *ipaddr){
926
- if (ipaddr){
931
+ if (ipaddr && ipaddr-> u_addr . ip4 . addr ){
927
932
connect (IPAddress (ipaddr->u_addr .ip4 .addr ), _connect_port);
928
933
} else {
929
934
if (_error_cb) {
You can’t perform that action at this time.
0 commit comments