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

+7-3
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

+1-1
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

+12
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

+1-1
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

+1-1
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

+3-3
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

+1-1
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

+5-5
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

+3-7
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

+1-2
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);

websocketpp/transport/asio/security/tls.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,7 @@ class connection : public lib::enable_shared_from_this<connection> {
193193
if (!m_context) {
194194
return socket::make_error_code(socket::error::invalid_tls_context);
195195
}
196-
m_socket = lib::make_shared<socket_type>(
197-
_WEBSOCKETPP_REF(*service),lib::ref(*m_context));
196+
m_socket.reset(new socket_type(*service, *m_context));
198197

199198
if (m_socket_init_handler) {
200199
m_socket_init_handler(m_hdl, get_socket());

websocketpp/version.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static int const major_version = 0;
4444
/// Library minor version number
4545
static int const minor_version = 8;
4646
/// Library patch version number
47-
static int const patch_version = 1;
47+
static int const patch_version = 2;
4848
/// Library pre-release flag
4949
/**
5050
* This is a textual flag indicating the type and number for pre-release
@@ -54,7 +54,7 @@ static int const patch_version = 1;
5454
static char const prerelease_flag[] = "";
5555

5656
/// Default user agent string
57-
static char const user_agent[] = "WebSocket++/0.8.1";
57+
static char const user_agent[] = "WebSocket++/0.8.2";
5858

5959
} // namespace websocketpp
6060

0 commit comments

Comments
 (0)