From 8e27ddbbfd9f7199f6a0c4149750cc394f91bb75 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Mon, 25 Oct 2021 07:51:48 +0200 Subject: [PATCH] [DEV] uptate new lutin declaration model --- .gitignore | 5 +++ GLD_enet-test-client-http.json | 21 +++++++++ GLD_enet-test-client-websocket.json | 21 +++++++++ GLD_enet-test-client.json | 22 ++++++++++ GLD_enet-test-server-http.json | 21 +++++++++ GLD_enet-test-server-websocket.json | 21 +++++++++ GLD_enet-test-server.json | 21 +++++++++ GLD_enet-test.json | 22 ++++++++++ GLD_enet.json | 56 ++++++++++++++++++++++++ enet/Http.cpp | 11 ++++- enet/Http.hpp | 1 + lutin_enet-test-client-http.py | 44 ------------------- lutin_enet-test-client-websocket.py | 44 ------------------- lutin_enet-test-client.py | 44 ------------------- lutin_enet-test-server-http.py | 44 ------------------- lutin_enet-test-server-websocket.py | 44 ------------------- lutin_enet-test-server.py | 44 ------------------- lutin_enet-test.py | 45 ------------------- lutin_enet.py | 68 ----------------------------- 19 files changed, 221 insertions(+), 378 deletions(-) create mode 100644 GLD_enet-test-client-http.json create mode 100644 GLD_enet-test-client-websocket.json create mode 100644 GLD_enet-test-client.json create mode 100644 GLD_enet-test-server-http.json create mode 100644 GLD_enet-test-server-websocket.json create mode 100644 GLD_enet-test-server.json create mode 100644 GLD_enet-test.json create mode 100644 GLD_enet.json delete mode 100644 lutin_enet-test-client-http.py delete mode 100644 lutin_enet-test-client-websocket.py delete mode 100644 lutin_enet-test-client.py delete mode 100644 lutin_enet-test-server-http.py delete mode 100644 lutin_enet-test-server-websocket.py delete mode 100644 lutin_enet-test-server.py delete mode 100644 lutin_enet-test.py delete mode 100644 lutin_enet.py diff --git a/.gitignore b/.gitignore index b08d134..a01c9de 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,8 @@ +__pycache__ +.bck +out +target +build ################################### # folders diff --git a/GLD_enet-test-client-http.json b/GLD_enet-test-client-http.json new file mode 100644 index 0000000..830166d --- /dev/null +++ b/GLD_enet-test-client-http.json @@ -0,0 +1,21 @@ +{ + "type":"BINARY", + "sub-type":"SAMPLE", + "group-id":"com.atria-soft", + "description":"e-net TEST test software for enet", + "license":"MPL-2", + "license-file":"file://LICENCE.txt", + "maintainer":"file://authors.txt", + "author":"file://authors.txt", + "version":"file://version.txt", + "code-quality":"MEDIUM", + + "source": [ + "test/main-client-http.cpp" + ], + "dependency": [ + "enet", + "etest", + "test-debug" + ] +} \ No newline at end of file diff --git a/GLD_enet-test-client-websocket.json b/GLD_enet-test-client-websocket.json new file mode 100644 index 0000000..e4692a1 --- /dev/null +++ b/GLD_enet-test-client-websocket.json @@ -0,0 +1,21 @@ +{ + "type":"BINARY", + "sub-type":"SAMPLE", + "group-id":"com.atria-soft", + "description":"e-net TEST test software for enet", + "license":"MPL-2", + "license-file":"file://LICENCE.txt", + "maintainer":"file://authors.txt", + "author":"file://authors.txt", + "version":"file://version.txt", + "code-quality":"MEDIUM", + + "source": [ + "test/main-client-websocket.cpp" + ], + "dependency": [ + "enet", + "etest", + "test-debug" + ] +} \ No newline at end of file diff --git a/GLD_enet-test-client.json b/GLD_enet-test-client.json new file mode 100644 index 0000000..278d783 --- /dev/null +++ b/GLD_enet-test-client.json @@ -0,0 +1,22 @@ +{ + "type":"BINARY", + "sub-type":"SAMPLE", + "group-id":"com.atria-soft", + "description":"e-net TEST test software for enet", + "license":"MPL-2", + "license-file":"file://LICENCE.txt", + "maintainer":"file://authors.txt", + "author":"file://authors.txt", + "version":"file://version.txt", + "code-quality":"MEDIUM", + + "source": [ + "test/main-client.cpp" + ], + "dependency": [ + "enet", + "etest", + "test-debug" + ] +} + diff --git a/GLD_enet-test-server-http.json b/GLD_enet-test-server-http.json new file mode 100644 index 0000000..20561c4 --- /dev/null +++ b/GLD_enet-test-server-http.json @@ -0,0 +1,21 @@ +{ + "type":"BINARY", + "sub-type":"SAMPLE", + "group-id":"com.atria-soft", + "description":"e-net TEST test software for enet", + "license":"MPL-2", + "license-file":"file://LICENCE.txt", + "maintainer":"file://authors.txt", + "author":"file://authors.txt", + "version":"file://version.txt", + "code-quality":"MEDIUM", + + "source": [ + "test/main-server-http.cpp" + ], + "dependency": [ + "enet", + "etest", + "test-debug" + ] +} \ No newline at end of file diff --git a/GLD_enet-test-server-websocket.json b/GLD_enet-test-server-websocket.json new file mode 100644 index 0000000..8393bb4 --- /dev/null +++ b/GLD_enet-test-server-websocket.json @@ -0,0 +1,21 @@ +{ + "type":"BINARY", + "sub-type":"SAMPLE", + "group-id":"com.atria-soft", + "description":"e-net TEST test software for enet", + "license":"MPL-2", + "license-file":"file://LICENCE.txt", + "maintainer":"file://authors.txt", + "author":"file://authors.txt", + "version":"file://version.txt", + "code-quality":"MEDIUM", + + "source": [ + "test/main-server-websocket.cpp" + ], + "dependency": [ + "enet", + "etest", + "test-debug" + ] +} \ No newline at end of file diff --git a/GLD_enet-test-server.json b/GLD_enet-test-server.json new file mode 100644 index 0000000..e191801 --- /dev/null +++ b/GLD_enet-test-server.json @@ -0,0 +1,21 @@ +{ + "type":"BINARY", + "sub-type":"SAMPLE", + "group-id":"com.atria-soft", + "description":"e-net TEST test software for enet", + "license":"MPL-2", + "license-file":"file://LICENCE.txt", + "maintainer":"file://authors.txt", + "author":"file://authors.txt", + "version":"file://version.txt", + "code-quality":"MEDIUM", + + "source": [ + "test/main-server.cpp" + ], + "dependency": [ + "enet", + "etest", + "test-debug" + ] +} \ No newline at end of file diff --git a/GLD_enet-test.json b/GLD_enet-test.json new file mode 100644 index 0000000..214950f --- /dev/null +++ b/GLD_enet-test.json @@ -0,0 +1,22 @@ +{ + "type":"BINARY", + "sub-type":"TEST", + "group-id":"com.atria-soft", + "description":"e-net TEST basic backend", + "license":"MPL-2", + "license-file":"file://LICENCE.txt", + "maintainer":"file://authors.txt", + "author":"file://authors.txt", + "version":"file://version.txt", + "code-quality":"MEDIUM", + + "source": [ + "test/main-test.cpp", + "test/main-unit-pourcentEncoding.cpp" + ], + "dependency": [ + "enet", + "etest", + "test-debug" + ] +} \ No newline at end of file diff --git a/GLD_enet.json b/GLD_enet.json new file mode 100644 index 0000000..8fdb88c --- /dev/null +++ b/GLD_enet.json @@ -0,0 +1,56 @@ +{ + "type":"LIBRARY", + "group-id":"com.atria-soft", + "description":"Algorithm generic", + "license":"MPL-2", + "license-file":"file://LICENCE.txt", + "maintainer":"file://authors.txt", + "author":"file://authors.txt", + "version":"file://version.txt", + "code-quality":"MEDIUM", + + "source": [ + "enet/debug.cpp", + "enet/enet.cpp", + "enet/Udp.cpp", + "enet/Tcp.cpp", + "enet/TcpServer.cpp", + "enet/TcpClient.cpp", + "enet/Http.cpp", + "enet/Ftp.cpp", + "enet/WebSocket.cpp", + "enet/pourcentEncoding.cpp" + ], + "header": [ + "enet/enet.hpp", + "enet/debug.hpp", + "enet/Udp.hpp", + "enet/Tcp.hpp", + "enet/TcpServer.hpp", + "enet/TcpClient.hpp", + "enet/Http.hpp", + "enet/Ftp.hpp", + "enet/WebSocket.hpp", + "enet/pourcentEncoding.hpp" + ], + "path":[ + "." + ], + "compilation-version": { + "language": "c++", + "version": 2017 + }, + "dependency": [ + "etk", + "ememory", + "algue", + "ethread" + ], + "target": { + "windows":{ + "dependency": [ + "ws2" + ] + } + } +} \ No newline at end of file diff --git a/enet/Http.cpp b/enet/Http.cpp index df4bddc..b117ffc 100644 --- a/enet/Http.cpp +++ b/enet/Http.cpp @@ -443,6 +443,7 @@ void enet::Http::getHeader() { } } //parse first element: + ENET_INFO("Request: " << list[0]); etk::Vector listLineOne = etk::split(list[0], ' '); if (listLineOne.size() < 2) { ENET_ERROR("can not parse answear : " << listLineOne); @@ -481,6 +482,10 @@ void enet::Http::getHeader() { m_requestHeader.setQuery(pourcentUriDecode(basicUri.extract(pos+1))); } // Get http version: + while ( m_requestHeader.getUri().size() > 0 + && m_requestHeader.getUri()[0] == '/') { + m_requestHeader.setUri(m_requestHeader.getUri().extract(1)); + } enum enet::HTTPProtocol valueProtocol; etk::from_string(valueProtocol, listLineOne[2]); m_requestHeader.setProtocol(valueProtocol); @@ -730,6 +735,10 @@ enet::HttpAnswer::HttpAnswer(enum HTTPAnswerCode _code, const etk::String& _help } +etk::String enet::HttpAnswer::getAutoData() const { + return "


" + etk::toString(m_what) + ": " + getProtocolName()[m_what] + "
"; +} + void enet::HttpAnswer::display() const { ENET_PRINT("display header 'Answer' "); ENET_PRINT(" protocol=" << m_protocol); @@ -841,4 +850,4 @@ etk::Stream& enet::operator <<(etk::Stream& _os, enum enet::HTTPAnswerCode _obj) etk::Stream& enet::operator <<(etk::Stream& _os, enum enet::HTTPReqType _obj) { _os << "enet::HTTPReqType::" << etk::toString(_obj); return _os; -} \ No newline at end of file +} diff --git a/enet/Http.hpp b/enet/Http.hpp index 42c2b4a..2c2b0ef 100644 --- a/enet/Http.hpp +++ b/enet/Http.hpp @@ -165,6 +165,7 @@ namespace enet { const etk::String& getHelp() const { return m_helpMessage; } + etk::String getAutoData() const; }; enum class HTTPReqType { HTTP_GET, diff --git a/lutin_enet-test-client-http.py b/lutin_enet-test-client-http.py deleted file mode 100644 index 64688b2..0000000 --- a/lutin_enet-test-client-http.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python -import realog.debug as debug -import lutin.tools as tools - - -def get_type(): - return "BINARY" - -def get_sub_type(): - return "TEST" - -def get_desc(): - return "e-net TEST test software for enet" - -def get_licence(): - return "MPL-2" - -def get_compagny_type(): - return "com" - -def get_compagny_name(): - return "atria-soft" - -def get_maintainer(): - return "authors.txt" - -def configure(target, my_module): - my_module.add_path(".") - my_module.add_depend([ - 'enet', - 'etest', - 'test-debug' - ]) - my_module.add_src_file([ - 'test/main-client-http.cpp' - ]) - return True - - - - - - - diff --git a/lutin_enet-test-client-websocket.py b/lutin_enet-test-client-websocket.py deleted file mode 100644 index 64b510d..0000000 --- a/lutin_enet-test-client-websocket.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python -import realog.debug as debug -import lutin.tools as tools - - -def get_type(): - return "BINARY" - -def get_sub_type(): - return "TEST" - -def get_desc(): - return "e-net TEST test software for enet" - -def get_licence(): - return "MPL-2" - -def get_compagny_type(): - return "com" - -def get_compagny_name(): - return "atria-soft" - -def get_maintainer(): - return "authors.txt" - -def configure(target, my_module): - my_module.add_path(".") - my_module.add_depend([ - 'enet', - 'etest', - 'test-debug' - ]) - my_module.add_src_file([ - 'test/main-client-websocket.cpp' - ]) - return True - - - - - - - diff --git a/lutin_enet-test-client.py b/lutin_enet-test-client.py deleted file mode 100644 index 0710bb6..0000000 --- a/lutin_enet-test-client.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python -import realog.debug as debug -import lutin.tools as tools - - -def get_type(): - return "BINARY" - -def get_sub_type(): - return "TEST" - -def get_desc(): - return "e-net TEST test software for enet" - -def get_licence(): - return "MPL-2" - -def get_compagny_type(): - return "com" - -def get_compagny_name(): - return "atria-soft" - -def get_maintainer(): - return "authors.txt" - -def configure(target, my_module): - my_module.add_path(".") - my_module.add_depend([ - 'enet', - 'etest', - 'test-debug' - ]) - my_module.add_src_file([ - 'test/main-client.cpp' - ]) - return True - - - - - - - diff --git a/lutin_enet-test-server-http.py b/lutin_enet-test-server-http.py deleted file mode 100644 index 35d206b..0000000 --- a/lutin_enet-test-server-http.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python -import realog.debug as debug -import lutin.tools as tools - - -def get_type(): - return "BINARY" - -def get_sub_type(): - return "TEST" - -def get_desc(): - return "e-net TEST test software for enet" - -def get_licence(): - return "MPL-2" - -def get_compagny_type(): - return "com" - -def get_compagny_name(): - return "atria-soft" - -def get_maintainer(): - return "authors.txt" - -def configure(target, my_module): - my_module.add_path(".") - my_module.add_depend([ - 'enet', - 'etest', - 'test-debug' - ]) - my_module.add_src_file([ - 'test/main-server-http.cpp' - ]) - return True - - - - - - - diff --git a/lutin_enet-test-server-websocket.py b/lutin_enet-test-server-websocket.py deleted file mode 100644 index ac82a15..0000000 --- a/lutin_enet-test-server-websocket.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python -import realog.debug as debug -import lutin.tools as tools - - -def get_type(): - return "BINARY" - -def get_sub_type(): - return "TEST" - -def get_desc(): - return "e-net TEST test software for enet" - -def get_licence(): - return "MPL-2" - -def get_compagny_type(): - return "com" - -def get_compagny_name(): - return "atria-soft" - -def get_maintainer(): - return "authors.txt" - -def configure(target, my_module): - my_module.add_path(".") - my_module.add_depend([ - 'enet', - 'etest', - 'test-debug' - ]) - my_module.add_src_file([ - 'test/main-server-websocket.cpp' - ]) - return True - - - - - - - diff --git a/lutin_enet-test-server.py b/lutin_enet-test-server.py deleted file mode 100644 index 78c9880..0000000 --- a/lutin_enet-test-server.py +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/python -import realog.debug as debug -import lutin.tools as tools - - -def get_type(): - return "BINARY" - -def get_sub_type(): - return "TEST" - -def get_desc(): - return "e-net TEST test software for enet" - -def get_licence(): - return "MPL-2" - -def get_compagny_type(): - return "com" - -def get_compagny_name(): - return "atria-soft" - -def get_maintainer(): - return "authors.txt" - -def configure(target, my_module): - my_module.add_path(".") - my_module.add_depend([ - 'enet', - 'etest', - 'test-debug' - ]) - my_module.add_src_file([ - 'test/main-server.cpp' - ]) - return True - - - - - - - diff --git a/lutin_enet-test.py b/lutin_enet-test.py deleted file mode 100644 index 86275e2..0000000 --- a/lutin_enet-test.py +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/python -import realog.debug as debug -import lutin.tools as tools - - -def get_type(): - return "BINARY" - -def get_sub_type(): - return "TEST" - -def get_desc(): - return "e-net TEST basic backend" - -def get_licence(): - return "MPL-2" - -def get_compagny_type(): - return "com" - -def get_compagny_name(): - return "atria-soft" - -def get_maintainer(): - return "authors.txt" - -def configure(target, my_module): - my_module.add_path(".") - my_module.add_depend([ - 'enet', - 'etest', - 'test-debug' - ]) - my_module.add_src_file([ - 'test/main-test.cpp', - 'test/main-unit-pourcentEncoding.cpp' - ]) - return True - - - - - - - diff --git a/lutin_enet.py b/lutin_enet.py deleted file mode 100644 index 53a134d..0000000 --- a/lutin_enet.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/python -import realog.debug as debug -import lutin.tools as tools - - -def get_type(): - return "LIBRARY" - -def get_desc(): - return "TCP/UDP/HTTP/FTP interface" - -def get_licence(): - return "MPL-2" - -def get_compagny_type(): - return "com" - -def get_compagny_name(): - return "atria-soft" - -def get_maintainer(): - return "authors.txt" - -def get_version(): - return "version.txt" - -def configure(target, my_module): - my_module.add_depend([ - 'etk', - 'ememory', - 'algue', - 'ethread' - ]) - my_module.add_path(".") - my_module.add_src_file([ - 'enet/debug.cpp', - 'enet/enet.cpp', - 'enet/Udp.cpp', - 'enet/Tcp.cpp', - 'enet/TcpServer.cpp', - 'enet/TcpClient.cpp', - 'enet/Http.cpp', - 'enet/Ftp.cpp', - 'enet/WebSocket.cpp', - 'enet/pourcentEncoding.cpp', - ]) - my_module.add_header_file([ - 'enet/enet.hpp', - 'enet/debug.hpp', - 'enet/Udp.hpp', - 'enet/Tcp.hpp', - 'enet/TcpServer.hpp', - 'enet/TcpClient.hpp', - 'enet/Http.hpp', - 'enet/Ftp.hpp', - 'enet/WebSocket.hpp', - 'enet/pourcentEncoding.hpp', - ]) - if "Windows" in target.get_type(): - my_module.add_depend("ws2"); - return True - - - - - - -