Skip to content

Commit 56123c8

Browse files
author
Peter Thorson
committed
Merge branch 'develop'
# Conflicts: # CMakeLists.txt
2 parents 72e2760 + 1c79f4c commit 56123c8

File tree

12 files changed

+38
-28
lines changed

12 files changed

+38
-28
lines changed

CMakeLists.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ endif ()
2424
############ Project name and version
2525
set (WEBSOCKETPP_MAJOR_VERSION 0)
2626
set (WEBSOCKETPP_MINOR_VERSION 8)
27-
set (WEBSOCKETPP_PATCH_VERSION 1)
27+
set (WEBSOCKETPP_PATCH_VERSION 2)
2828
set (WEBSOCKETPP_VERSION ${WEBSOCKETPP_MAJOR_VERSION}.${WEBSOCKETPP_MINOR_VERSION}.${WEBSOCKETPP_PATCH_VERSION})
2929

3030
if(POLICY CMP0048)
@@ -123,7 +123,11 @@ if (BUILD_TESTS OR BUILD_EXAMPLES)
123123

124124
# g++
125125
if (CMAKE_COMPILER_IS_GNUCXX)
126-
set (WEBSOCKETPP_PLATFORM_LIBS pthread rt)
126+
if (NOT APPLE)
127+
set (WEBSOCKETPP_PLATFORM_LIBS pthread rt)
128+
else()
129+
set (WEBSOCKETPP_PLATFORM_LIBS pthread)
130+
endif()
127131
set (WEBSOCKETPP_PLATFORM_TLS_LIBS ssl crypto)
128132
set (WEBSOCKETPP_BOOST_LIBS system thread)
129133
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
@@ -202,7 +206,7 @@ if (BUILD_TESTS OR BUILD_EXAMPLES)
202206
endif ()
203207

204208
if (NOT Boost_USE_STATIC_LIBS)
205-
add_definitions (/DBOOST_TEST_DYN_LINK)
209+
add_definitions (-DBOOST_TEST_DYN_LINK)
206210
endif ()
207211

208212
set (Boost_FIND_REQUIRED TRUE)

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ PROJECT_NAME = WebSocket++
3838
# could be handy for archiving the generated documentation or if some version
3939
# control system is used.
4040

41-
PROJECT_NUMBER = 0.8.1
41+
PROJECT_NUMBER = 0.8.2
4242

4343
# Using the PROJECT_BRIEF tag one can provide an optional one line description
4444
# for a project that appears at the top of each page and should give viewer a

changelog.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
HEAD
22

3+
0.8.2 - 2020-04-19
4+
- Examples: Update print_client_tls example to remove use of deprecated
5+
OpenSSL functions.
6+
- Compatibility: Removes the use of make_shared in a number of cases where
7+
it would be incompatible with newer versions of ASIO. Thank you Stefan
8+
Floeren for the patch. #810 #814 #862 #843 #794 #808
9+
- CMake: Update cmake installer to better handle dependencies when using
10+
g++ on MacOS. Thank you Luca Palano for reporting and a patch. #831
11+
- CMake: Update cmake installer to use a variable for the include directory
12+
improving the ability of the install to be customized. THank you Schrijvers
13+
Luc and Gianfranco Costamanga for reporting and a patch. #842
14+
315
0.8.1 - 2018-07-16
416
Note: This release does not change library behavior. It only corrects issues
517
in the installer and test system.

cmake/CMakeHelpers.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ macro (final_target)
8080
endif ()
8181

8282
install (DIRECTORY ${CMAKE_SOURCE_DIR}/${TARGET_NAME}
83-
DESTINATION include/
83+
DESTINATION ${INSTALL_INCLUDE_DIR}/
8484
FILES_MATCHING PATTERN "*.hpp*")
8585
endmacro ()
8686

docs/faq.dox

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ If you handle errors from methods like send, ping, close, etc correctly then you
5555

5656
Normally, for security purposes, operating systems prevent programs from listening on sockets created by other programs. When your program crashes and restarts, the new instance is a different program from the perspective of the operating system. As such it can’t listen on the socket address/port that the previous program was using until after a timeout occurs to make sure the old program was done with it.
5757

58-
The the first step for handling this is to make sure that you provide a method (signal handler, admin websocket message, etc) to perform a clean server shutdown. There is a question elsewhere in this FAQ that describes the steps necessary for this.
58+
The first step for handling this is to make sure that you provide a method (signal handler, admin websocket message, etc) to perform a clean server shutdown. There is a question elsewhere in this FAQ that describes the steps necessary for this.
5959

6060
The clean close strategy won't help in the case of crashes or other abnormal closures. An option to consider for these cases is the use of the SO_REUSEADDR socket option. This instructs the OS to not request an exclusive lock on the socket. This means that after your program crashes the replacement you start can immediately listen on that address/port combo again.
6161

examples/print_client_tls/print_client_tls.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ bool verify_subject_alternative_name(const char * hostname, X509 * cert) {
6161
continue;
6262
}
6363

64-
char * dns_name = (char *) ASN1_STRING_data(current_name->d.dNSName);
64+
char const * dns_name = (char const *) ASN1_STRING_get0_data(current_name->d.dNSName);
6565

6666
// Make sure there isn't an embedded NUL character in the DNS name
6767
if (ASN1_STRING_length(current_name->d.dNSName) != strlen(dns_name)) {
@@ -76,7 +76,7 @@ bool verify_subject_alternative_name(const char * hostname, X509 * cert) {
7676
}
7777

7878
/// Verify that the certificate common name matches the given hostname
79-
bool verify_common_name(const char * hostname, X509 * cert) {
79+
bool verify_common_name(char const * hostname, X509 * cert) {
8080
// Find the position of the CN field in the Subject field of the certificate
8181
int common_name_loc = X509_NAME_get_index_by_NID(X509_get_subject_name(cert), NID_commonName, -1);
8282
if (common_name_loc < 0) {
@@ -95,7 +95,7 @@ bool verify_common_name(const char * hostname, X509 * cert) {
9595
return false;
9696
}
9797

98-
char * common_name_str = (char *) ASN1_STRING_data(common_name_asn1);
98+
char const * common_name_str = (char const *) ASN1_STRING_get0_data(common_name_asn1);
9999

100100
// Make sure there isn't an embedded NUL character in the CN
101101
if (ASN1_STRING_length(common_name_asn1) != strlen(common_name_str)) {

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
WebSocket++ (0.8.1)
1+
WebSocket++ (0.8.2)
22
==========================
33

44
WebSocket++ is a header only C++ library that implements RFC6455 The WebSocket

websocketpp/transport/asio/connection.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -311,9 +311,10 @@ class connection : public config::socket_type::socket_con_type {
311311
* needed.
312312
*/
313313
timer_ptr set_timer(long duration, timer_handler callback) {
314-
timer_ptr new_timer = lib::make_shared<lib::asio::steady_timer>(
315-
lib::ref(*m_io_service),
316-
lib::asio::milliseconds(duration)
314+
timer_ptr new_timer(
315+
new lib::asio::steady_timer(
316+
*m_io_service,
317+
lib::asio::milliseconds(duration))
317318
);
318319

319320
if (config::enable_multithreading) {
@@ -461,8 +462,7 @@ class connection : public config::socket_type::socket_con_type {
461462
m_io_service = io_service;
462463

463464
if (config::enable_multithreading) {
464-
m_strand = lib::make_shared<lib::asio::io_service::strand>(
465-
lib::ref(*io_service));
465+
m_strand.reset(new lib::asio::io_service::strand(*io_service));
466466
}
467467

468468
lib::error_code ec = socket_con_type::init_asio(io_service, m_strand,

websocketpp/transport/asio/endpoint.hpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ class endpoint : public config::socket_type {
195195

196196
m_io_service = ptr;
197197
m_external_io_service = true;
198-
m_acceptor = lib::make_shared<lib::asio::ip::tcp::acceptor>(
199-
lib::ref(*m_io_service));
198+
m_acceptor.reset(new lib::asio::ip::tcp::acceptor(*m_io_service));
200199

201200
m_state = READY;
202201
ec = lib::error_code();
@@ -688,9 +687,7 @@ class endpoint : public config::socket_type {
688687
* @since 0.3.0
689688
*/
690689
void start_perpetual() {
691-
m_work = lib::make_shared<lib::asio::io_service::work>(
692-
lib::ref(*m_io_service)
693-
);
690+
m_work.reset(new lib::asio::io_service::work(*m_io_service));
694691
}
695692

696693
/// Clears the endpoint's perpetual flag, allowing it to exit when empty
@@ -854,8 +851,7 @@ class endpoint : public config::socket_type {
854851

855852
// Create a resolver
856853
if (!m_resolver) {
857-
m_resolver = lib::make_shared<lib::asio::ip::tcp::resolver>(
858-
lib::ref(*m_io_service));
854+
m_resolver.reset(new lib::asio::ip::tcp::resolver(*m_io_service));
859855
}
860856

861857
tcon->set_uri(u);

websocketpp/transport/asio/security/none.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,7 @@ class connection : public lib::enable_shared_from_this<connection> {
168168
return socket::make_error_code(socket::error::invalid_state);
169169
}
170170

171-
m_socket = lib::make_shared<lib::asio::ip::tcp::socket>(
172-
lib::ref(*service));
171+
m_socket.reset(new lib::asio::ip::tcp::socket(*service));
173172

174173
if (m_socket_init_handler) {
175174
m_socket_init_handler(m_hdl, *m_socket);

0 commit comments

Comments
 (0)