Do not use input header for error responses
When parsing of the input header fails, it could be for a variety of
issues, including an overflow of the language tag length. We should not
utilize any variable aspects of the header in our response and
instead just send back a default of all 0's with the static fields set
along with error the code.
Utilize std::bitset to get the function ID properly written to
cout/cerr.
Tested:
- Verified when sending in an invalid header, it no longer can cause
unexpected error paths in parseHeader function
Change-Id: I17a8a013bcd90e083b1156f794f059fc1b830a63
Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
diff --git a/meson.build b/meson.build
index 4c28048..5f90ea5 100644
--- a/meson.build
+++ b/meson.build
@@ -39,3 +39,17 @@
include_directories: '../'
)
)
+
+ test(
+ 'test_slp_message_handler',
+ executable('test_slp_message_handler',
+ './test/slp_message_handler_test.cpp',
+ 'slp_parser.cpp',
+ 'slp_message_handler.cpp',
+ dependencies: [
+ gtest,
+ ],
+ implicit_include_directories: true,
+ include_directories: '../'
+ )
+ )