Fixes to track updates in esp-idf

This commit is contained in:
negativekelvin 2018-06-16 08:53:48 -07:00 committed by Andy Green
parent 4d252d847b
commit bd9c1b715f
5 changed files with 17 additions and 16 deletions

View File

@ -25,7 +25,7 @@ build:
-DBUILD_DIR_BASE=$(BUILD_DIR_BASE) \
-DCMAKE_TOOLCHAIN_FILE=$(COMPONENT_PATH)/contrib/cross-esp32.cmake \
-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_HTTP2=1 \
-DLWS_WITH_RANGES=1 \

View File

@ -17,6 +17,7 @@ set(CMAKE_LINKER "${CROSS_PATH}/bin/xtensa-esp32-elf-ld${EXECUTABLE_EXT}")
SET(CMAKE_C_FLAGS "-nostdlib -Wall -Werror \
-I${BUILD_DIR_BASE}/include \
-I${IDF_PATH}/components/newlib/platform_include \
-I${IDF_PATH}/components/mdns/include \
-I${IDF_PATH}/components/heap/include \
-I${IDF_PATH}/components/driver/include \

View File

@ -93,18 +93,12 @@
#define LWS_H2_RX_SCRATCH_SIZE 512
#ifndef LWS_HAVE_BZERO
#ifndef bzero
#define bzero(b, len) (memset((b), '\0', (len)), (void) 0)
#endif
#endif
#define lws_socket_is_valid(x) (x != LWS_SOCK_INVALID)
#ifndef LWS_HAVE_STRERROR
#define strerror(x) ""
#endif
#define lws_socket_is_valid(x) (x != LWS_SOCK_INVALID)
/*
*
* ------ private platform defines ------
@ -125,6 +119,12 @@
#endif
#endif
#ifndef LWS_HAVE_BZERO
#ifndef bzero
#define bzero(b, len) (memset((b), '\0', (len)), (void) 0)
#endif
#endif
/*
*
* ------ public api ------

View File

@ -126,25 +126,25 @@ _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi)
if (pt->fds[n].fd >= max_fd)
max_fd = pt->fds[n].fd;
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)
FD_SET(pt->fds[n].fd - LWIP_SOCKET_OFFSET, &writefds);
FD_SET(pt->fds[n].fd - LWIP_SOCKET_OFFSET, &errfds);
FD_SET(pt->fds[n].fd, &writefds);
FD_SET(pt->fds[n].fd, &errfds);
}
n = select(max_fd + 1, &readfds, &writefds, &errfds, ptv);
n = 0;
for (m = 0; m < pt->fds_count; m++) {
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;
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;
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);
pt->fds[m].revents |= LWS_POLLHUP;
c = 1;

View File

@ -48,7 +48,7 @@ lws_send_pipe_choked(struct lws *wsi)
return 1;
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);
if (n < 0)
@ -64,7 +64,7 @@ lws_poll_listen_fd(struct lws_pollfd *fd)
struct timeval tv = { 0, 0 };
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);
}