fix code style

This commit is contained in:
Links
2022-04-05 19:10:57 +02:00
parent 8d76469e90
commit ab9af162b2
5 changed files with 48 additions and 48 deletions

View File

@ -42,13 +42,13 @@ extern "C" {
#include <esp_system.h>
#if ESP_IDF_VERSION_MAJOR >= 4
#if ( ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(1, 0, 6) )
#include "sha/sha_parallel_engine.h"
#else
#include <esp32/sha.h>
#endif
#if(ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(1, 0, 6))
#include "sha/sha_parallel_engine.h"
#else
#include <hwcrypto/sha.h>
#include <esp32/sha.h>
#endif
#else
#include <hwcrypto/sha.h>
#endif
#else
@ -472,7 +472,7 @@ void WebSockets::handleWebsocketPayloadCb(WSclient_t * client, bool ok, uint8_t
payload[header->payloadLen] = 0x00;
if(header->mask) {
//decode XOR
// decode XOR
for(size_t i = 0; i < header->payloadLen; i++) {
payload[i] = (payload[i] ^ header->maskKey[i % 4]);
}
@ -526,7 +526,7 @@ void WebSockets::handleWebsocketPayloadCb(WSclient_t * client, bool ok, uint8_t
// reset input
client->cWsRXsize = 0;
#if(WEBSOCKETS_NETWORK_TYPE == NETWORK_ESP8266_ASYNC)
//register callback for next message
// register callback for next message
handleWebsocketWaitFor(client, 2);
#endif
@ -644,9 +644,9 @@ bool WebSockets::readCb(WSclient_t * client, uint8_t * out, size_t n, WSreadWait
t = millis();
out += len;
n -= len;
//DEBUG_WEBSOCKETS("Receive %d left %d!\n", len, n);
// DEBUG_WEBSOCKETS("Receive %d left %d!\n", len, n);
} else {
//DEBUG_WEBSOCKETS("Receive %d left %d!\n", len, n);
// DEBUG_WEBSOCKETS("Receive %d left %d!\n", len, n);
}
if(n > 0) {
WEBSOCKETS_YIELD();
@ -698,7 +698,7 @@ size_t WebSockets::write(WSclient_t * client, uint8_t * out, size_t n) {
out += len;
n -= len;
total += len;
//DEBUG_WEBSOCKETS("write %d left %d!\n", len, n);
// DEBUG_WEBSOCKETS("write %d left %d!\n", len, n);
} else {
DEBUG_WEBSOCKETS("WS write %d failed left %d!\n", len, n);
}

View File

@ -86,7 +86,7 @@
#define WEBSOCKETS_YIELD_MORE()
#else
//atmega328p has only 2KB ram!
// atmega328p has only 2KB ram!
#define WEBSOCKETS_MAX_DATA_SIZE (1024)
// moves all Header strings to Flash
#define WEBSOCKETS_SAVE_RAM

View File

@ -621,7 +621,7 @@ WSclient_t * WebSocketsServerCore::handleNewClient(WEBSOCKETS_NETWORK_CLASS * tc
#endif
// no client! => create dummy!
WSclient_t dummy = WSclient_t();
client = & dummy;
client = &dummy;
client->tcp = tcpClient;
dropNativeClient(client);
}
@ -663,7 +663,7 @@ void WebSocketsServerCore::handleClientData(void) {
if(clientIsConnected(client)) {
int len = client->tcp->available();
if(len > 0) {
//DEBUG_WEBSOCKETS("[WS-Server][%d][handleClientData] len: %d\n", client->num, len);
// DEBUG_WEBSOCKETS("[WS-Server][%d][handleClientData] len: %d\n", client->num, len);
switch(client->status) {
case WSC_HEADER: {
String headerLine = client->tcp->readStringUntil('\n');
@ -717,7 +717,7 @@ void WebSocketsServerCore::handleHeader(WSclient_t * client, String * headerLine
// cut URL out
client->cUrl = headerLine->substring(4, headerLine->indexOf(' ', 4));
//reset non-websocket http header validation state for this client
// reset non-websocket http header validation state for this client
client->cHttpHeadersValid = true;
client->cMandatoryHeadersCount = 0;

View File

@ -192,10 +192,10 @@ class WebSocketsServerCore : protected WebSockets {
*/
virtual bool execHttpHeaderValidation(String headerName, String headerValue) {
if(_httpHeaderValidationFunc) {
//return the value of the custom http header validation function
// return the value of the custom http header validation function
return _httpHeaderValidationFunc(headerName, headerValue);
}
//no custom http header validation so just assume all is good
// no custom http header validation so just assume all is good
return true;
}