Skip to content

Commit 11fefbb

Browse files
Fix install of header files
Also now build FETPAPI with Wintls on windows CI and check that all header files are correctly installed
1 parent 74ea5c5 commit 11fefbb

4 files changed

Lines changed: 22 additions & 9 deletions

File tree

.github/workflows/github-actions.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ jobs:
6565
run: |
6666
curl -L "https://archives.boost.io/release/1.90.0/binaries/boost_1_90_0-msvc-14.2-64.exe" -o "${{ runner.temp }}\boost.exe"
6767
Start-Process -Wait -FilePath "${{ runner.temp }}\boost.exe" "/SILENT","/SP-","/SUPPRESSMSGBOXES","/DIR=${{ runner.temp }}\boost-install"
68+
- name : Wintls install
69+
run: |
70+
git clone -b v1.0.0 https://github.com/laudrup/boost-wintls.git ${{ runner.temp }}\wintls
6871
- name: AVRO install
6972
run: |
7073
cd ${{ runner.temp }}
@@ -83,8 +86,20 @@ jobs:
8386
cd ${{ github.workspace }}/..
8487
mkdir build
8588
cd build
86-
cmake -G"Visual Studio 17 2022" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DBoost_INCLUDE_DIR=${{ runner.temp }}\boost-install -DAVRO_ROOT=${{ runner.temp }}/avro-cpp-install -DAVRO_USE_STATIC_LIBS=TRUE -DWITH_FESAPI=TRUE -DFESAPI_ROOT=${{ runner.temp }}/fesapi2_14_1_0-cpp-vs2019-x64 -DWITH_ETP_SSL=FALSE ${{ github.workspace }}
89+
cmake -G"Visual Studio 17 2022" -A x64 -T host=x64 -Wno-dev -Wno-deprecated -DBoost_INCLUDE_DIR=${{ runner.temp }}\boost-install -DAVRO_ROOT=${{ runner.temp }}/avro-cpp-install -DAVRO_USE_STATIC_LIBS=TRUE -DWITH_FESAPI=TRUE -DFESAPI_ROOT=${{ runner.temp }}/fesapi2_14_1_0-cpp-vs2019-x64 -DWINTLS_ROOT=${{ runner.temp }}\wintls ${{ github.workspace }}
8790
cmake --build . --config Release -j2
91+
cmake --install .
92+
- name: Compare install header files vs source header files
93+
shell: bash
94+
run: |
95+
dir1="${{ github.workspace }}/src"
96+
dir2="${{ github.workspace }}/../build/install/include"
97+
diff <(cd "$dir1" && find . -type f -name "*.h" | sort) <(cd "$dir2" && find . -type f -name "*.h" | sort)
98+
if [ $? -ne 0 ]; then
99+
echo "❌ The directories have not the same .h files"
100+
exit 1
101+
fi
102+
echo "✅ The directories have the same .h files"
88103
ubuntu-22:
89104
runs-on: ubuntu-22.04
90105
steps:

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,13 @@ install(EXPORT Fetpapi-export
290290
)
291291

292292
INSTALL (
293-
FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/macroDefinitions.h
293+
FILES ${FETPAPI_HEADERS}
294294
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fetpapi
295295
COMPONENT fetpapi_headers
296296
)
297297

298298
INSTALL (
299-
FILES ${FETPAPI_HEADERS}
299+
FILES ${FETPAPI_ETP_HEADERS}
300300
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/fetpapi/etp
301301
COMPONENT fetpapi_headers
302302
)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Download (build and install if necessary) third party libraries:
1313
- BOOST : All versions from version 1.66 should be ok but you may experience some [min/max build issues](https://github.com/boostorg/beast/issues/1980) using version 1.72 or 1.73.
1414
- AVRO : https://avro.apache.org/releases.html#Download (starting from version 1.9.0 [except 1.11.1](https://issues.apache.org/jira/browse/AVRO-3601), build it with the above boost library.)
1515
- (OPTIONALLY) OpenSSL : version 3.4 is known to work. OpenSSL is mandatory on Unix environement if you want SSL/TLS support. On Windows environment, you can depends on [Wintls](https://github.com/laudrup/boost-wintls/tree/master) instead
16-
- (OPTIONALLY) [Wintls](https://github.com/laudrup/boost-wintls/tree/master) : Starting from version 0.9.9. Only on Windows and only if you don't want to use OpenSSL to support SSL/TLS. FYI, WinTLs uses native Windows API [(SSPI/Schannel)](https://docs.microsoft.com/en-us/windows-server/security/tls/tls-ssl-schannel-ssp-overview) functionality instead of OpenSSL for providing TLS encrypted stream functionality.
16+
- (OPTIONALLY) [Wintls](https://github.com/laudrup/boost-wintls/tree/master) : Starting from version 0.9.9. Only on Windows and only if you don't want to use OpenSSL to support SSL/TLS. FYI, Wintls uses native Windows API [(SSPI/Schannel)](https://docs.microsoft.com/en-us/windows-server/security/tls/tls-ssl-schannel-ssp-overview) functionality instead of OpenSSL for providing TLS encrypted stream functionality.
1717
- (OPTIONALLY) [FESAPI](https://github.com/F2I-Consulting/fesapi/releases) : All versions from version 2.7.0.0 should be ok but a minimal version of 2.11.0.0 is recommended to automatically recognize FESAPI CMake Variables using CMake find Module and build silently the EtpClient example.
1818

1919
# Configure the build

src/etp/AbstractSession.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ void AbstractSession::on_read(boost::system::error_code ec, std::size_t bytes_tr
140140
}
141141
} // Scope for specificProtocolHandlersLock
142142

143-
size_t receivedMhProtocol = static_cast<size_t>(receivedMh.protocol);
144143
if (specificProtocolHandler) {
145144
// Receive a message which has been asked to be processed with a specific protocol handler
146145
specificProtocolHandler->decodeMessageBody(receivedMh, d);
@@ -157,14 +156,13 @@ void AbstractSession::on_read(boost::system::error_code ec, std::size_t bytes_tr
157156
}
158157
}
159158
else {
160-
auto normalProtocolHandlerIt = protocolHandlers.find(receivedMhProtocol);
161-
if (normalProtocolHandlerIt != protocolHandlers.end()) {
159+
if (auto normalProtocolHandlerIt = protocolHandlers.find(receivedMh.protocol); normalProtocolHandlerIt != protocolHandlers.end()) {
162160
// Receive a message to be processed with a common protocol handler in case for example an unsollicited notification
163161
normalProtocolHandlerIt->second->decodeMessageBody(receivedMh, d);
164162
}
165163
else {
166-
std::cerr << "Received a message with id " << receivedMh.messageId << " for which no protocol handler is associated. Protocol " << receivedMhProtocol << std::endl;
167-
send(ETP_NS::EtpHelpers::buildSingleMessageProtocolException(4, "The agent does not support the protocol " + std::to_string(receivedMhProtocol) + " identified in a message header."), receivedMh.messageId, 0x02);
164+
std::cerr << "Received a message with id " << receivedMh.messageId << " for which no protocol handler is associated. Protocol " << receivedMh.protocol << std::endl;
165+
send(ETP_NS::EtpHelpers::buildSingleMessageProtocolException(4, "The agent does not support the protocol " + std::to_string(receivedMh.protocol) + " identified in a message header."), receivedMh.messageId, 0x02);
168166
}
169167
}
170168
}

0 commit comments

Comments
 (0)