From 85e99d2059de4d11e9966ca7174f638b29426eb3 Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Mon, 10 Sep 2018 22:14:19 +0200 Subject: [PATCH] Move things around some more --- 15.pro | 4 ++-- src/http/HttpApp.h | 4 +++- src/http/HttpSocket.h | 2 +- src/new_design/HttpContext.h | 2 ++ src/new_design/HttpContextData.h | 7 +++---- src/{http => new_design}/HttpParser.h | 0 src/{http => new_design}/HttpRouter.h | 0 7 files changed, 11 insertions(+), 8 deletions(-) rename src/{http => new_design}/HttpParser.h (100%) rename src/{http => new_design}/HttpRouter.h (100%) diff --git a/15.pro b/15.pro index 9bb4024..b31baf4 100644 --- a/15.pro +++ b/15.pro @@ -13,11 +13,11 @@ SOURCES += \ uSockets/src/loop.c HEADERS += \ - src/http/HttpRouter.h \ + src/new_design/HttpRouter.h \ src/Loop.h \ src/App.h \ src/http/HttpSocket.h \ - src/http/HttpParser.h \ + src/new_design/HttpParser.h \ src/websocket/libwshandshake.hpp \ src/websocket/WebSocketProtocol.h \ src/websocket/WebSocket.h \ diff --git a/src/http/HttpApp.h b/src/http/HttpApp.h index 9cbc117..79bea78 100644 --- a/src/http/HttpApp.h +++ b/src/http/HttpApp.h @@ -1,10 +1,12 @@ #ifndef HTTPAPP_H #define HTTPAPP_H +// todo: move all this logic to HttpContext + #include #include "Loop.h" #include "HttpSocket.h" -#include "HttpRouter.h" +#include "../new_design/HttpRouter.h" #include "websocket/libwshandshake.hpp" #include "websocket/WebSocket.h" diff --git a/src/http/HttpSocket.h b/src/http/HttpSocket.h index 1960932..c42e5fe 100644 --- a/src/http/HttpSocket.h +++ b/src/http/HttpSocket.h @@ -2,7 +2,7 @@ #define HTTP_H #include "Socket.h" -#include "HttpParser.h" +#include "../new_design/HttpParser.h" #include #include diff --git a/src/new_design/HttpContext.h b/src/new_design/HttpContext.h index 409e0f7..eaf283d 100644 --- a/src/new_design/HttpContext.h +++ b/src/new_design/HttpContext.h @@ -48,6 +48,8 @@ public: // todo: inplace initialize the data struct! + // todo: actually register handlers on the socket context with the behavior of HTTP! (take from HttpApp.h) + return (HttpContext *) us_create_socket_context(loop, sizeof(HttpContextData)); } diff --git a/src/new_design/HttpContextData.h b/src/new_design/HttpContextData.h index 8d87a8a..4bbea49 100644 --- a/src/new_design/HttpContextData.h +++ b/src/new_design/HttpContextData.h @@ -1,10 +1,9 @@ #ifndef HTTPCONTEXTDATA_H #define HTTPCONTEXTDATA_H -// this means we will depend on HttpRouter and HttpParser here! -#include "../http/HttpParser.h" - -#include "../http/HttpRouter.h" +// we depend on these +#include "HttpParser.h" +#include "HttpRouter.h" #include diff --git a/src/http/HttpParser.h b/src/new_design/HttpParser.h similarity index 100% rename from src/http/HttpParser.h rename to src/new_design/HttpParser.h diff --git a/src/http/HttpRouter.h b/src/new_design/HttpRouter.h similarity index 100% rename from src/http/HttpRouter.h rename to src/new_design/HttpRouter.h