diff --git a/apps/smtp/smtp.c b/apps/smtp/smtp.c index 6a9f828..0d6d483 100644 --- a/apps/smtp/smtp.c +++ b/apps/smtp/smtp.c @@ -34,6 +34,7 @@ #include "lwip/dns.h" #include +#include /** This is simple SMTP client for raw API. * It is a minimal implementation of SMTP as specified in RFC 5321. @@ -283,16 +284,15 @@ static char smtp_auth_plain[SMTP_MAX_USERNAME_LEN + SMTP_MAX_PASS_LEN + 3]; /** Length of smtp_auth_plain string (cannot use strlen since it includes \0) */ static size_t smtp_auth_plain_len; -static size_t max_tx_buf_len; -static size_t max_rx_buf_len; - static err_t smtp_verify(const char *data, size_t data_len, u8_t linebreaks_allowed); static err_t smtp_tcp_recv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err); static void smtp_tcp_err(void *arg, err_t err); static err_t smtp_tcp_poll(void *arg, struct tcp_pcb *pcb); static err_t smtp_tcp_sent(void *arg, struct tcp_pcb *pcb, u16_t len); static err_t smtp_tcp_connected(void *arg, struct tcp_pcb *pcb, err_t err); +#if LWIP_DNS static void smtp_dns_found(const char* hostname, ip_addr_t *ipaddr, void *arg); +#endif /* LWIP_DNS */ static size_t smtp_base64_encode(char* target, size_t target_len, const char* source, size_t source_len); static enum smtp_session_state smtp_prepare_mail(struct smtp_session *s, u16_t *tx_buf_len); static void smtp_send_body(struct smtp_session *s, struct tcp_pcb *pcb); @@ -758,6 +758,7 @@ smtp_tcp_connected(void *arg, struct tcp_pcb *pcb, err_t err) return ERR_OK; } +#if LWIP_DNS /** DNS callback * If ipaddr is non-NULL, resolving succeeded, otherwise it failed. */ @@ -786,6 +787,7 @@ smtp_dns_found(const char* hostname, ip_addr_t *ipaddr, void *arg) } smtp_close(pcb->callback_arg, pcb, result, 0, err); } +#endif /* LWIP_DNS */ #if SMTP_SUPPORT_AUTH_AUTH || SMTP_SUPPORT_AUTH_LOGIN