8000 wrap reasonCode in define · BirdAPI/arduinoWebSockets@f7a7ab6 · GitHub
[go: up one dir, main page]

Skip to content

Commit f7a7ab6

Browse files
authored
wrap reasonCode in define
see Links2004#343
1 parent bdee8b9 commit f7a7ab6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/WebSockets.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,12 @@ void WebSockets::handleWebsocketPayloadCb(WSclient_t * client, bool ok, uint8_t
440440
DEBUG_WEBSOCKETS("[WS][%d][handleWebsocket] get pong (%s)\n", client->num, payload ? (const char*)payload : "");
441441
break;
442442
case WSop_close: {
443-
uint16_t reasonCode = 1000;
444-
if(header->payloadLen >= 2) {
445-
reasonCode = payload[0] << 8 | payload[1];
446-
}
447-
443+
#ifndef NODEBUG_WEBSOCKETS
444+
uint16_t reasonCode = 1000;
445+
if(header->payloadLen >= 2) {
446+
reasonCode = payload[0] << 8 | payload[1];
447+
}
448+
#endif
448449
DEBUG_WEBSOCKETS("[WS][%d][handleWebsocket] get ask for close. Code: %d", client->num, reasonCode);
449450
if(header->payloadLen > 2) {
450451
DEBUG_WEBSOCKETS(" (%s)\n", (payload + 2));

0 commit comments

Comments
 (0)
0