File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
ports/espressif/common-hal/socketpool Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,16 @@ void common_hal_socketpool_socketpool_construct(socketpool_socketpool_obj_t *sel
4545mp_obj_t common_hal_socketpool_socketpool_gethostbyname (socketpool_socketpool_obj_t * self ,
4646 const char * host ) {
4747
48+ // As of 2022, the version of lwip in esp-idf does not handle the
49+ // trailing-dot syntax of domain names, so emulate it.
50+ // Remove this once https://github.com/espressif/esp-idf/issues/10013 has
51+ // been implemented
52+ size_t strlen_host = strlen (host );
53+ if (strlen_host && host [strlen_host - 1 ] == '.' ) {
54+ mp_obj_t nodot = mp_obj_new_str (host , strlen_host - 1 );
55+ host = mp_obj_str_get_str (nodot );
56+ }
57+
4858 const struct addrinfo hints = {
4959 .ai_family = AF_INET ,
5060 .ai_socktype = SOCK_STREAM ,
You can’t perform that action at this time.
0 commit comments