diff options
author | Manojkiran Eda <manojkiran.eda@gmail.com> | 2020-06-27 07:22:23 +0300 |
---|---|---|
committer | Gunnar Mills <gmills@us.ibm.com> | 2020-07-01 19:13:12 +0300 |
commit | 6f115bbbfdf9d45bad404bf88fc4fe2ffa745a9e (patch) | |
tree | 12bf1ceb532f1aa55d4ce7fe9abb1138dc106d23 /redfish-core/lib/redfish_sessions.hpp | |
parent | 6eda7685694dca84db5a1b86b497c8d1e9fcbd06 (diff) | |
download | bmcweb-6f115bbbfdf9d45bad404bf88fc4fe2ffa745a9e.tar.xz |
Fix : Compilation issue when ssl is disabled
- When the SSL is disabled, the socket that bmcweb uses would be
a basic_socket type , and that does not have a next_layer as that
itself is the basic socket, we can directly read the socket object/
or use the lowest_layer() of the socket to get the ip address from it.
- When SSL is enabled, the socket that bmcweb uses would be an ssl
stream over basic_socket, and here the next_layer would be basic_socket,
so the existing logic holds good.
- The idea behind this commit is to , have a conditional check for SSL
vs non-SSL configurations before reading the socket for ip address.
Tested By:
* cmake -DBMCWEB_INSECURE_DISABLE_SSL=1 -DCMAKE_BUILD_TYPE:type=Debug ../ ; make
- The above Compilation was successfull.
Signed-off-by: Manojkiran Eda <manojkiran.eda@gmail.com>
Change-Id: I2b9a127be30b11b056641342e0af06118c526528
Diffstat (limited to 'redfish-core/lib/redfish_sessions.hpp')
-rw-r--r-- | redfish-core/lib/redfish_sessions.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/redfish-core/lib/redfish_sessions.hpp b/redfish-core/lib/redfish_sessions.hpp index 1ec2303abe..8080e6f69d 100644 --- a/redfish-core/lib/redfish_sessions.hpp +++ b/redfish-core/lib/redfish_sessions.hpp @@ -227,8 +227,13 @@ class SessionCollection : public Node } } #endif + +#ifdef BMCWEB_ENABLE_SSL clientIp = req.socket().next_layer().remote_endpoint().address().to_string(); +#else + clientIp = req.socket().remote_endpoint().address().to_string(); +#endif // User is authenticated - create session std::shared_ptr<crow::persistent_data::UserSession> session = |