kopia lustrzana https://github.com/micropython/micropython-lib
urequests: Always open sockets in SOCK_STREAM mode.
On the ESP32, socket.getaddrinfo() might return SOCK_DGRAM instead of SOCK_STREAM, eg with ".local" adresses. As a HTTP request is always a TCP stream, we don't need to rely on the values returned by getaddrinfo.pull/502/head
rodzic
b29cffb3e3
commit
a725c42049
|
@ -72,7 +72,7 @@ def request(
|
|||
if parse_headers is not False:
|
||||
resp_d = {}
|
||||
|
||||
s = usocket.socket(ai[0], ai[1], ai[2])
|
||||
s = usocket.socket(ai[0], usocket.SOCK_STREAM, ai[2])
|
||||
try:
|
||||
s.connect(ai[-1])
|
||||
if proto == "https:":
|
||||
|
|
Ładowanie…
Reference in New Issue