esphome / ESPAsyncWebServer

Async Web Server for ESP8266 and ESP32
81 stars 62 forks source link

Update AsyncWebSocket.cpp #11

Closed CRSLEE closed 1 year ago

thorrak commented 1 year ago

+1 on this

bjun626 commented 1 year ago

+1

munzili commented 1 year ago

+1

rob040 commented 1 year ago

@asjdf: This change (#10) causes compilation error in platformIO esp32:

Compiling .pio\build\esp32dev_dbg\liba26\ESPAsyncWebServer-esphome\AsyncWebSocket.cpp.o
.pio/libdeps/esp32dev_dbg/ESPAsyncWebServer-esphome/src/AsyncWebSocket.cpp: In function 'size_t webSocketSendFrame(AsyncClient*, bool, uint8_t, bool, uint8_t*, size_t)':
.pio/libdeps/esp32dev_dbg/ESPAsyncWebServer-esphome/src/AsyncWebSocket.cpp:105:7: warning: init-statement in selection statements only available with -std=c++17 or -std=gnu++17
   if (!client->send();) return 0;
       ^
.pio/libdeps/esp32dev_dbg/ESPAsyncWebServer-esphome/src/AsyncWebSocket.cpp:105:23: error: expected primary-expression before ')' token
   if (!client->send();) return 0;
                       ^
*
** [.pio\build\esp32dev_dbg\liba26\ESPAsyncWebServer-esphome\AsyncWebSocket.cpp.o] Error 1

Removing the ';' solves the error.

asjdf commented 1 year ago

I noticed this issue and previous PR #17 could fix this issue too, thanks for your notice and I am trying to contact the maintainer of this lib.❤️

jesserockz commented 1 year ago

Apologies this was not noticed and merged earlier. Closing as https://github.com/esphome/ESPAsyncWebServer/pull/17 has been merged.