mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
Fixes to track updates in esp-idf
This commit is contained in:
parent
4d252d847b
commit
bd9c1b715f
5 changed files with 17 additions and 16 deletions
|
@ -25,7 +25,7 @@ build:
|
||||||
-DBUILD_DIR_BASE=$(BUILD_DIR_BASE) \
|
-DBUILD_DIR_BASE=$(BUILD_DIR_BASE) \
|
||||||
-DCMAKE_TOOLCHAIN_FILE=$(COMPONENT_PATH)/contrib/cross-esp32.cmake \
|
-DCMAKE_TOOLCHAIN_FILE=$(COMPONENT_PATH)/contrib/cross-esp32.cmake \
|
||||||
-DCMAKE_BUILD_TYPE=RELEASE \
|
-DCMAKE_BUILD_TYPE=RELEASE \
|
||||||
-DLWS_MBEDTLS_INCLUDE_DIRS="${IDF_PATH}/components/openssl/include;${IDF_PATH}/components/mbedtls/include;${IDF_PATH}/components/mbedtls/port/include" \
|
-DLWS_MBEDTLS_INCLUDE_DIRS="${IDF_PATH}/components/openssl/include;${IDF_PATH}/components/mbedtls/mbedtls/include;${IDF_PATH}/components/mbedtls/port/include" \
|
||||||
-DLWS_WITH_STATS=0 \
|
-DLWS_WITH_STATS=0 \
|
||||||
-DLWS_WITH_HTTP2=1 \
|
-DLWS_WITH_HTTP2=1 \
|
||||||
-DLWS_WITH_RANGES=1 \
|
-DLWS_WITH_RANGES=1 \
|
||||||
|
|
|
@ -17,6 +17,7 @@ set(CMAKE_LINKER "${CROSS_PATH}/bin/xtensa-esp32-elf-ld${EXECUTABLE_EXT}")
|
||||||
|
|
||||||
SET(CMAKE_C_FLAGS "-nostdlib -Wall -Werror \
|
SET(CMAKE_C_FLAGS "-nostdlib -Wall -Werror \
|
||||||
-I${BUILD_DIR_BASE}/include \
|
-I${BUILD_DIR_BASE}/include \
|
||||||
|
-I${IDF_PATH}/components/newlib/platform_include \
|
||||||
-I${IDF_PATH}/components/mdns/include \
|
-I${IDF_PATH}/components/mdns/include \
|
||||||
-I${IDF_PATH}/components/heap/include \
|
-I${IDF_PATH}/components/heap/include \
|
||||||
-I${IDF_PATH}/components/driver/include \
|
-I${IDF_PATH}/components/driver/include \
|
||||||
|
|
|
@ -93,18 +93,12 @@
|
||||||
|
|
||||||
#define LWS_H2_RX_SCRATCH_SIZE 512
|
#define LWS_H2_RX_SCRATCH_SIZE 512
|
||||||
|
|
||||||
#ifndef LWS_HAVE_BZERO
|
#define lws_socket_is_valid(x) (x != LWS_SOCK_INVALID)
|
||||||
#ifndef bzero
|
|
||||||
#define bzero(b, len) (memset((b), '\0', (len)), (void) 0)
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef LWS_HAVE_STRERROR
|
#ifndef LWS_HAVE_STRERROR
|
||||||
#define strerror(x) ""
|
#define strerror(x) ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define lws_socket_is_valid(x) (x != LWS_SOCK_INVALID)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ------ private platform defines ------
|
* ------ private platform defines ------
|
||||||
|
@ -125,6 +119,12 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef LWS_HAVE_BZERO
|
||||||
|
#ifndef bzero
|
||||||
|
#define bzero(b, len) (memset((b), '\0', (len)), (void) 0)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
* ------ public api ------
|
* ------ public api ------
|
||||||
|
|
|
@ -126,25 +126,25 @@ _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi)
|
||||||
if (pt->fds[n].fd >= max_fd)
|
if (pt->fds[n].fd >= max_fd)
|
||||||
max_fd = pt->fds[n].fd;
|
max_fd = pt->fds[n].fd;
|
||||||
if (pt->fds[n].events & LWS_POLLIN)
|
if (pt->fds[n].events & LWS_POLLIN)
|
||||||
FD_SET(pt->fds[n].fd - LWIP_SOCKET_OFFSET, &readfds);
|
FD_SET(pt->fds[n].fd, &readfds);
|
||||||
if (pt->fds[n].events & LWS_POLLOUT)
|
if (pt->fds[n].events & LWS_POLLOUT)
|
||||||
FD_SET(pt->fds[n].fd - LWIP_SOCKET_OFFSET, &writefds);
|
FD_SET(pt->fds[n].fd, &writefds);
|
||||||
FD_SET(pt->fds[n].fd - LWIP_SOCKET_OFFSET, &errfds);
|
FD_SET(pt->fds[n].fd, &errfds);
|
||||||
}
|
}
|
||||||
|
|
||||||
n = select(max_fd + 1, &readfds, &writefds, &errfds, ptv);
|
n = select(max_fd + 1, &readfds, &writefds, &errfds, ptv);
|
||||||
n = 0;
|
n = 0;
|
||||||
for (m = 0; m < pt->fds_count; m++) {
|
for (m = 0; m < pt->fds_count; m++) {
|
||||||
c = 0;
|
c = 0;
|
||||||
if (FD_ISSET(pt->fds[m].fd - LWIP_SOCKET_OFFSET, &readfds)) {
|
if (FD_ISSET(pt->fds[m].fd, &readfds)) {
|
||||||
pt->fds[m].revents |= LWS_POLLIN;
|
pt->fds[m].revents |= LWS_POLLIN;
|
||||||
c = 1;
|
c = 1;
|
||||||
}
|
}
|
||||||
if (FD_ISSET(pt->fds[m].fd - LWIP_SOCKET_OFFSET, &writefds)) {
|
if (FD_ISSET(pt->fds[m].fd, &writefds)) {
|
||||||
pt->fds[m].revents |= LWS_POLLOUT;
|
pt->fds[m].revents |= LWS_POLLOUT;
|
||||||
c = 1;
|
c = 1;
|
||||||
}
|
}
|
||||||
if (FD_ISSET(pt->fds[m].fd - LWIP_SOCKET_OFFSET, &errfds)) {
|
if (FD_ISSET(pt->fds[m].fd, &errfds)) {
|
||||||
// lwsl_notice("errfds %d\n", pt->fds[m].fd);
|
// lwsl_notice("errfds %d\n", pt->fds[m].fd);
|
||||||
pt->fds[m].revents |= LWS_POLLHUP;
|
pt->fds[m].revents |= LWS_POLLHUP;
|
||||||
c = 1;
|
c = 1;
|
||||||
|
|
|
@ -48,7 +48,7 @@ lws_send_pipe_choked(struct lws *wsi)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
FD_ZERO(&writefds);
|
FD_ZERO(&writefds);
|
||||||
FD_SET(wsi_eff->desc.sockfd - LWIP_SOCKET_OFFSET, &writefds);
|
FD_SET(wsi_eff->desc.sockfd, &writefds);
|
||||||
|
|
||||||
n = select(wsi_eff->desc.sockfd + 1, NULL, &writefds, NULL, &tv);
|
n = select(wsi_eff->desc.sockfd + 1, NULL, &writefds, NULL, &tv);
|
||||||
if (n < 0)
|
if (n < 0)
|
||||||
|
@ -64,7 +64,7 @@ lws_poll_listen_fd(struct lws_pollfd *fd)
|
||||||
struct timeval tv = { 0, 0 };
|
struct timeval tv = { 0, 0 };
|
||||||
|
|
||||||
FD_ZERO(&readfds);
|
FD_ZERO(&readfds);
|
||||||
FD_SET(fd->fd - LWIP_SOCKET_OFFSET, &readfds);
|
FD_SET(fd->fd, &readfds);
|
||||||
|
|
||||||
return select(fd->fd + 1, &readfds, NULL, NULL, &tv);
|
return select(fd->fd + 1, &readfds, NULL, NULL, &tv);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue