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
45
45
mp_obj_t common_hal_socketpool_socketpool_gethostbyname (socketpool_socketpool_obj_t * self ,
46
46
const char * host ) {
47
47
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
+
48
58
const struct addrinfo hints = {
49
59
.ai_family = AF_INET ,
50
60
.ai_socktype = SOCK_STREAM ,
You can’t perform that action at this time.
0 commit comments