diff --git a/src/App.h b/src/App.h index f61e3f5..b2c5be4 100644 --- a/src/App.h +++ b/src/App.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef APP_H -#define APP_H +#ifndef UWS_APP_H +#define UWS_APP_H /* An app is a convenience wrapper of some of the most used fuctionalities and allows a * builder-pattern kind of init. Apps operate on the implicit thread local Loop */ @@ -26,8 +26,7 @@ #include "WebSocketContext.h" #include "WebSocket.h" #include "WebSocketExtensions.h" - -#include "libwshandshake.hpp" +#include "WebSocketHandshake.h" namespace uWS { @@ -320,4 +319,4 @@ typedef TemplatedApp SSLApp; } -#endif // APP_H +#endif // UWS_APP_H diff --git a/src/AsyncSocket.h b/src/AsyncSocket.h index d99d886..9afc157 100644 --- a/src/AsyncSocket.h +++ b/src/AsyncSocket.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef ASYNCSOCKET_H -#define ASYNCSOCKET_H +#ifndef UWS_ASYNCSOCKET_H +#define UWS_ASYNCSOCKET_H /* This class implements async socket memory management strategies */ @@ -223,4 +223,4 @@ struct AsyncSocket { } -#endif // ASYNCSOCKET_H +#endif // UWS_ASYNCSOCKET_H diff --git a/src/AsyncSocketData.h b/src/AsyncSocketData.h index 0e121da..010116e 100644 --- a/src/AsyncSocketData.h +++ b/src/AsyncSocketData.h @@ -15,8 +15,10 @@ * limitations under the License. */ -#ifndef ASYNCSOCKETDATA_H -#define ASYNCSOCKETDATA_H +#ifndef UWS_ASYNCSOCKETDATA_H +#define UWS_ASYNCSOCKETDATA_H + +namespace uWS { /* Depending on how we want AsyncSocket to function, this will need to change */ @@ -36,4 +38,6 @@ struct AsyncSocketData { AsyncSocketData() = default; }; -#endif // ASYNCSOCKETDATA_H +} + +#endif // UWS_ASYNCSOCKETDATA_H diff --git a/src/HttpContext.h b/src/HttpContext.h index c788852..cf7d89c 100644 --- a/src/HttpContext.h +++ b/src/HttpContext.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef HTTPCONTEXT_H -#define HTTPCONTEXT_H +#ifndef UWS_HTTPCONTEXT_H +#define UWS_HTTPCONTEXT_H /* This class defines the main behavior of HTTP and emits various events */ @@ -359,4 +359,4 @@ public: } -#endif // HTTPCONTEXT_H +#endif // UWS_HTTPCONTEXT_H diff --git a/src/HttpContextData.h b/src/HttpContextData.h index 5b57ddd..33d4be5 100644 --- a/src/HttpContextData.h +++ b/src/HttpContextData.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef HTTPCONTEXTDATA_H -#define HTTPCONTEXTDATA_H +#ifndef UWS_HTTPCONTEXTDATA_H +#define UWS_HTTPCONTEXTDATA_H #include "HttpRouter.h" @@ -45,4 +45,4 @@ private: } -#endif // HTTPCONTEXTDATA_H +#endif // UWS_HTTPCONTEXTDATA_H diff --git a/src/HttpParser.h b/src/HttpParser.h index 0d6e211..fd3133d 100644 --- a/src/HttpParser.h +++ b/src/HttpParser.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef HTTPPARSER_H -#define HTTPPARSER_H +#ifndef UWS_HTTPPARSER_H +#define UWS_HTTPPARSER_H // todo: HttpParser is in need of a few clean-ups and refactorings @@ -331,4 +331,4 @@ public: } -#endif // HTTPPARSER_H +#endif // UWS_HTTPPARSER_H diff --git a/src/HttpResponse.h b/src/HttpResponse.h index 2796f3a..e11d1a0 100644 --- a/src/HttpResponse.h +++ b/src/HttpResponse.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef HTTPRESPONSE_H -#define HTTPRESPONSE_H +#ifndef UWS_HTTPRESPONSE_H +#define UWS_HTTPRESPONSE_H /* An HttpResponse is the channel on which you send back a response */ @@ -315,4 +315,4 @@ public: } -#endif // HTTPRESPONSE_H +#endif // UWS_HTTPRESPONSE_H diff --git a/src/HttpResponseData.h b/src/HttpResponseData.h index 21834fa..13540f7 100644 --- a/src/HttpResponseData.h +++ b/src/HttpResponseData.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef HTTPRESPONSEDATA_H -#define HTTPRESPONSEDATA_H +#ifndef UWS_HTTPRESPONSEDATA_H +#define UWS_HTTPRESPONSEDATA_H /* This data belongs to the HttpResponse */ @@ -54,4 +54,4 @@ private: } -#endif // HTTPRESPONSEDATA_H +#endif // UWS_HTTPRESPONSEDATA_H diff --git a/src/HttpRouter.h b/src/HttpRouter.h index 29ea708..95024f2 100644 --- a/src/HttpRouter.h +++ b/src/HttpRouter.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef HTTPROUTER_HPP -#define HTTPROUTER_HPP +#ifndef UWS_HTTPROUTER_HPP +#define UWS_HTTPROUTER_HPP // todo: this module also needs a few clean-ups and simplifications @@ -282,4 +282,4 @@ public: } -#endif // HTTPROUTER_HPP +#endif // UWS_HTTPROUTER_HPP diff --git a/src/Loop.h b/src/Loop.h index 1a62a1e..c071e70 100644 --- a/src/Loop.h +++ b/src/Loop.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef LOOP_H -#define LOOP_H +#ifndef UWS_LOOP_H +#define UWS_LOOP_H /* The loop is lazily created per-thread and run with uWS::run() */ @@ -162,4 +162,4 @@ inline void run() { } -#endif // LOOP_H +#endif // UWS_LOOP_H diff --git a/src/LoopData.h b/src/LoopData.h index 3419654..5dd4abc 100644 --- a/src/LoopData.h +++ b/src/LoopData.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef LOOPDATA_H -#define LOOPDATA_H +#ifndef UWS_LOOPDATA_H +#define UWS_LOOPDATA_H #include #include @@ -70,4 +70,4 @@ public: } -#endif // LOOPDATA_H +#endif // UWS_LOOPDATA_H diff --git a/src/PerMessageDeflate.h b/src/PerMessageDeflate.h index cc14873..5db6b71 100644 --- a/src/PerMessageDeflate.h +++ b/src/PerMessageDeflate.h @@ -17,8 +17,14 @@ /* This standalone module implements deflate / inflate streams */ -#ifndef PERMESSAGEDEFLATE_H -#define PERMESSAGEDEFLATE_H +#ifndef UWS_PERMESSAGEDEFLATE_H +#define UWS_PERMESSAGEDEFLATE_H + +#include +#include + +namespace uWS { + /* Do not compile this module if we don't want it */ #ifdef UWS_NO_ZLIB struct ZlibContext {}; @@ -34,9 +40,6 @@ struct DeflationStream { }; #else -#include -#include - #define LARGE_BUFFER_SIZE 1024 * 16 // todo: fix this struct ZlibContext { @@ -161,4 +164,7 @@ struct InflationStream { }; #endif -#endif // PERMESSAGEDEFLATE_H + +} + +#endif // UWS_PERMESSAGEDEFLATE_H diff --git a/src/TopicTree.h b/src/TopicTree.h index fe1e710..1ca3904 100644 --- a/src/TopicTree.h +++ b/src/TopicTree.h @@ -19,8 +19,8 @@ #include "Loop.h" #include "AsyncSocket.h" -#ifndef TOPICTREE_H -#define TOPICTREE_H +#ifndef UWS_TOPICTREE_H +#define UWS_TOPICTREE_H #include #include @@ -195,4 +195,4 @@ public: }; } -#endif // TOPICTREE_H +#endif // UWS_TOPICTREE_H diff --git a/src/Utilities.h b/src/Utilities.h index df63fd4..123bbfc 100644 --- a/src/Utilities.h +++ b/src/Utilities.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef UTILITIES_H -#define UTILITIES_H +#ifndef UWS_UTILITIES_H +#define UWS_UTILITIES_H /* Various common utilities */ @@ -63,4 +63,4 @@ inline int u32toa(uint32_t value, char *dst) { } } -#endif // UTILITIES_H +#endif // UWS_UTILITIES_H diff --git a/src/WebSocket.h b/src/WebSocket.h index 3a830f8..fc4822f 100644 --- a/src/WebSocket.h +++ b/src/WebSocket.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef WEBSOCKET_H -#define WEBSOCKET_H +#ifndef UWS_WEBSOCKET_H +#define UWS_WEBSOCKET_H #include "WebSocketData.h" #include "WebSocketProtocol.h" @@ -159,4 +159,4 @@ public: } -#endif // WEBSOCKET_H +#endif // UWS_WEBSOCKET_H diff --git a/src/WebSocketContext.h b/src/WebSocketContext.h index 7154eaf..1fb2b3b 100644 --- a/src/WebSocketContext.h +++ b/src/WebSocketContext.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef WEBSOCKETCONTEXT_H -#define WEBSOCKETCONTEXT_H +#ifndef UWS_WEBSOCKETCONTEXT_H +#define UWS_WEBSOCKETCONTEXT_H #include "WebSocketContextData.h" #include "WebSocketProtocol.h" @@ -371,4 +371,4 @@ public: } -#endif // WEBSOCKETCONTEXT_H +#endif // UWS_WEBSOCKETCONTEXT_H diff --git a/src/WebSocketContextData.h b/src/WebSocketContextData.h index de68edd..7e2fc27 100644 --- a/src/WebSocketContextData.h +++ b/src/WebSocketContextData.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef WEBSOCKETCONTEXTDATA_H -#define WEBSOCKETCONTEXTDATA_H +#ifndef UWS_WEBSOCKETCONTEXTDATA_H +#define UWS_WEBSOCKETCONTEXTDATA_H #include "f2/function2.hpp" #include @@ -47,4 +47,4 @@ struct WebSocketContextData { } -#endif // WEBSOCKETCONTEXTDATA_H +#endif // UWS_WEBSOCKETCONTEXTDATA_H diff --git a/src/WebSocketData.h b/src/WebSocketData.h index 2359e5f..2ed3003 100644 --- a/src/WebSocketData.h +++ b/src/WebSocketData.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef WEBSOCKETDATA_H -#define WEBSOCKETDATA_H +#ifndef UWS_WEBSOCKETDATA_H +#define UWS_WEBSOCKETDATA_H #include "WebSocketProtocol.h" #include "AsyncSocketData.h" @@ -60,4 +60,4 @@ public: } -#endif // WEBSOCKETDATA_H +#endif // UWS_WEBSOCKETDATA_H diff --git a/src/WebSocketExtensions.h b/src/WebSocketExtensions.h index ae027dc..1d3adf9 100644 --- a/src/WebSocketExtensions.h +++ b/src/WebSocketExtensions.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef WEBSOCKETEXTENSIONS_H -#define WEBSOCKETEXTENSIONS_H +#ifndef UWS_WEBSOCKETEXTENSIONS_H +#define UWS_WEBSOCKETEXTENSIONS_H #include @@ -158,4 +158,4 @@ public: } -#endif // WEBSOCKETEXTENSIONS_H +#endif // UWS_WEBSOCKETEXTENSIONS_H diff --git a/src/libwshandshake.hpp b/src/WebSocketHandshake.h similarity index 97% rename from src/libwshandshake.hpp rename to src/WebSocketHandshake.h index 9e9bf1d..a4f2fb7 100644 --- a/src/libwshandshake.hpp +++ b/src/WebSocketHandshake.h @@ -15,12 +15,14 @@ * limitations under the License. */ -#ifndef LIBWSHANDSHAKE_H -#define LIBWSHANDSHAKE_H +#ifndef UWS_WEBSOCKETHANDSHAKE_H +#define UWS_WEBSOCKETHANDSHAKE_H #include #include +namespace uWS { + class WebSocketHandshake { template struct static_for { @@ -127,4 +129,6 @@ public: } }; -#endif // LIBWSHANDSHAKE_H +} + +#endif // UWS_WEBSOCKETHANDSHAKE_H diff --git a/src/WebSocketProtocol.h b/src/WebSocketProtocol.h index ea4c086..020bb6d 100644 --- a/src/WebSocketProtocol.h +++ b/src/WebSocketProtocol.h @@ -15,8 +15,8 @@ * limitations under the License. */ -#ifndef WEBSOCKETPROTOCOL_UWS_H -#define WEBSOCKETPROTOCOL_UWS_H +#ifndef UWS_WEBSOCKETPROTOCOL_H +#define UWS_WEBSOCKETPROTOCOL_H #include #include @@ -430,4 +430,4 @@ public: } -#endif // WEBSOCKETPROTOCOL_UWS_H +#endif // UWS_WEBSOCKETPROTOCOL_H diff --git a/uSockets b/uSockets index 04295b9..f1cae03 160000 --- a/uSockets +++ b/uSockets @@ -1 +1 @@ -Subproject commit 04295b9730a4d413895fa3b151a7337797dcb91f +Subproject commit f1cae03ecdc0539f4155b964726065288b15c7a4