code style

This commit is contained in:
Links
2020-11-21 14:06:30 +01:00
parent 826c6b423a
commit 28cd929e7e

View File

@ -25,7 +25,7 @@
#include "WebSockets.h"
#include "WebSocketsServer.h"
WebSocketsServerCore::WebSocketsServerCore(const String& origin, const String& protocol) {
WebSocketsServerCore::WebSocketsServerCore(const String & origin, const String & protocol) {
_origin = origin;
_protocol = protocol;
_runnning = false;
@ -42,8 +42,8 @@ WebSocketsServerCore::WebSocketsServerCore(const String& origin, const String& p
memset(&_clients[0], 0x00, (sizeof(WSclient_t) * WEBSOCKETS_SERVER_CLIENT_MAX));
}
WebSocketsServer::WebSocketsServer(uint16_t port, const String& origin, const String& protocol):
WebSocketsServerCore(origin, protocol) {
WebSocketsServer::WebSocketsServer(uint16_t port, const String & origin, const String & protocol)
: WebSocketsServerCore(origin, protocol) {
_port = port;
_server = new WEBSOCKETS_NETWORK_SERVER_CLASS(port);
@ -538,8 +538,7 @@ void WebSocketsServerCore::messageReceived(WSclient_t * client, WSopcode_t opcod
* Discard a native client
* @param client WSclient_t * ptr to the client struct contaning the native client "->tcp"
*/
void WebSocketsServerCore::dropNativeClient (WSclient_t * client)
{
void WebSocketsServerCore::dropNativeClient(WSclient_t * client) {
if(client->tcp) {
if(client->tcp->connected()) {
#if(WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP8266_ASYNC) && (WEBSOCKETS_NETWORK_TYPE != NETWORK_ESP32)
@ -631,7 +630,6 @@ bool WebSocketsServerCore::clientIsConnected(WSclient_t * client) {
* Handle incoming Connection Request
*/
WSclient_t * WebSocketsServerCore::handleNewClient(WEBSOCKETS_NETWORK_CLASS * tcpClient) {
WSclient_t * client = newClient(tcpClient);
if(!client) {
@ -971,4 +969,3 @@ void WebSocketsServer::loop(void) {
}
}
#endif