mirror of
https://github.com/m5stack/M5Stack_MicroPython.git
synced 2026-05-20 10:14:44 -07:00
17 lines
780 B
Markdown
17 lines
780 B
Markdown
Used with **esp-idf**, **libcurl** needs some paches.
|
|
|
|
The problem with **Connection already in progress** is caused by the fact that the lwip sockets starts at `LWIP_SOCKET_OFFSET`.
|
|
|
|
`FD_SET`/`FD_GET` macros take this into account when operating on fd sets: `LWIP_SOCKET_OFFSET` is subtracted from fd number, and the resulting value as used as bit offset in fd set.
|
|
|
|
In curl (file lib/select.h), the macro `#define VALID_SOCK(s) (((s) >= 0) && ((s) < FD_SETSIZE))` checks the valid socket and fails with esp-idf lwip socket.
|
|
|
|
This macro has to be changed to:
|
|
|
|
`#define VALID_SOCK(s) (((s) - LWIP_SOCKET_OFFSET >= 0) && ((s) - LWIP_SOCKET_OFFSET < FD_SETSIZE))`
|
|
|
|
then everything works as expected.
|
|
|
|
Only directories **lib** and **include** from curl repository needs to be used.
|
|
|