Skip to content

Commit 2a95f04

Browse files
Merge pull request #68 from ESP32Async/ip_addr_t
struct ip_addr => ip_addr_t
2 parents f710bfb + 9286892 commit 2a95f04

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/AsyncTCP.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ void AsyncTCP_detail::tcp_error(void *arg, int8_t err) {
512512
_send_async_event(e);
513513
}
514514

515-
static void _tcp_dns_found(const char *name, struct ip_addr *ipaddr, void *arg) {
515+
static void _tcp_dns_found(const char *name, ip_addr_t *ipaddr, void *arg) {
516516
// ets_printf("+DNS: name=%s ipaddr=0x%08x arg=%x\n", name, ipaddr, arg);
517517
auto client = reinterpret_cast<AsyncClient *>(arg);
518518

@@ -524,7 +524,7 @@ static void _tcp_dns_found(const char *name, struct ip_addr *ipaddr, void *arg)
524524

525525
e->dns.name = name;
526526
if (ipaddr) {
527-
memcpy(&e->dns.addr, ipaddr, sizeof(struct ip_addr));
527+
memcpy(&e->dns.addr, ipaddr, sizeof(ip_addr_t));
528528
} else {
529529
memset(&e->dns.addr, 0, sizeof(e->dns.addr));
530530
}
@@ -1159,7 +1159,7 @@ int8_t AsyncClient::_poll(tcp_pcb *pcb) {
11591159
return ERR_OK;
11601160
}
11611161

1162-
void AsyncClient::_dns_found(struct ip_addr *ipaddr) {
1162+
void AsyncClient::_dns_found(ip_addr_t *ipaddr) {
11631163
if (ipaddr) {
11641164
connect(*ipaddr, _connect_port);
11651165
} else {

src/AsyncTCP.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ typedef std::function<void(void *, AsyncClient *, struct pbuf *pb)> AcPacketHand
7575
typedef std::function<void(void *, AsyncClient *, uint32_t time)> AcTimeoutHandler;
7676

7777
struct tcp_pcb;
78-
struct ip_addr;
7978
class AsyncTCP_detail;
8079

8180
class AsyncClient {
@@ -305,7 +304,7 @@ class AsyncClient {
305304
int8_t _sent(tcp_pcb *pcb, uint16_t len);
306305
int8_t _fin(tcp_pcb *pcb, int8_t err);
307306
int8_t _lwip_fin(tcp_pcb *pcb, int8_t err);
308-
void _dns_found(struct ip_addr *ipaddr);
307+
void _dns_found(ip_addr_t *ipaddr);
309308
};
310309

311310
class AsyncServer {

0 commit comments

Comments
 (0)