57
57
#else
58
58
#define _WEBSOCKETPP_NULLPTR_TOKEN_ 0
59
59
#endif
60
- #ifndef _MS_WINDOWS
61
60
#include < websocketpp/config/asio_client.hpp>
62
- #endif
63
61
#include < websocketpp/config/asio_no_tls_client.hpp>
64
62
#include < websocketpp/client.hpp>
65
63
#pragma warning( pop )
@@ -152,7 +150,6 @@ class wspp_client : public _websocket_client_impl, public std::enable_shared_fro
152
150
153
151
pplx::task<void > connect ()
154
152
{
155
- #ifndef _MS_WINDOWS
156
153
if (m_uri.scheme () == U (" wss" ))
157
154
{
158
155
m_client = std::unique_ptr<websocketpp_client_base>(new websocketpp_tls_client ());
@@ -184,16 +181,17 @@ class wspp_client : public _websocket_client_impl, public std::enable_shared_fro
184
181
return http::client::details::verify_cert_chain_platform_specific (verifyCtx, m_uri.host ());
185
182
}
186
183
#endif
187
- boost::asio::ssl::rfc2818_verification rfc2818 (m_uri.host ());
188
- return rfc2818 (preverified, verifyCtx);
184
+ boost::asio::ssl::rfc2818_verification rfc2818 (utility::conversions::to_utf8string (m_uri.host ()));
185
+ /* return*/ rfc2818 (preverified, verifyCtx);
186
+ // TODO
187
+ return true ;
189
188
});
190
189
191
190
return sslContext;
192
191
});
193
192
return connect_impl<websocketpp::config::asio_tls_client>();
194
193
}
195
194
else
196
- #endif
197
195
{
198
196
m_client = std::unique_ptr<websocketpp_client_base>(new websocketpp_client ());
199
197
return connect_impl<websocketpp::config::asio_client>();
@@ -402,13 +400,11 @@ class wspp_client : public _websocket_client_impl, public std::enable_shared_fro
402
400
403
401
void send_msg (websocket_outgoing_message &msg)
404
402
{
405
- #ifndef _MS_WINDOWS
406
403
if (m_client->is_tls_client ())
407
404
{
408
405
send_msg_impl<websocketpp::config::asio_tls_client>(msg);
409
406
}
410
407
else
411
- #endif
412
408
{
413
409
send_msg_impl<websocketpp::config::asio_client>(msg);
414
410
}
@@ -575,13 +571,11 @@ class wspp_client : public _websocket_client_impl, public std::enable_shared_fro
575
571
576
572
pplx::task<void > close (websocket_close_status status, const utility::string_t & reason)
577
573
{
578
- #ifndef _MS_WINDOWS
579
574
if (m_client->is_tls_client ())
580
575
{
581
576
return close_impl<websocketpp::config::asio_tls_client>(status, reason);
582
577
}
583
578
else
584
- #endif
585
579
{
586
580
return close_impl<websocketpp::config::asio_client>(status, reason);
587
581
}
@@ -633,13 +627,11 @@ class wspp_client : public _websocket_client_impl, public std::enable_shared_fro
633
627
template <typename WebsocketConfig>
634
628
websocketpp::client<WebsocketConfig> & client ()
635
629
{
636
- #ifndef _MS_WINDOWS
637
630
if (is_tls_client ())
638
631
{
639
632
return reinterpret_cast <websocketpp::client<WebsocketConfig> &>(tls_client ());
640
633
}
641
634
else
642
- #endif
643
635
{
644
636
return reinterpret_cast <websocketpp::client<WebsocketConfig> &>(non_tls_client ());
645
637
}
@@ -648,12 +640,10 @@ class wspp_client : public _websocket_client_impl, public std::enable_shared_fro
648
640
{
649
641
throw std::bad_cast ();
650
642
}
651
- #ifndef _MS_WINDOWS
652
643
virtual websocketpp::client<websocketpp::config::asio_tls_client> & tls_client ()
653
644
{
654
645
throw std::bad_cast ();
655
646
}
656
- #endif
657
647
virtual bool is_tls_client () const = 0;
658
648
};
659
649
struct websocketpp_client : websocketpp_client_base
@@ -665,7 +655,6 @@ class wspp_client : public _websocket_client_impl, public std::enable_shared_fro
665
655
bool is_tls_client () const override { return false ; }
666
656
websocketpp::client<websocketpp::config::asio_client> m_client;
667
657
};
668
- #ifndef _MS_WINDOWS
669
658
struct websocketpp_tls_client : websocketpp_client_base
670
659
{
671
660
websocketpp::client<websocketpp::config::asio_tls_client> & tls_client () override
@@ -675,7 +664,6 @@ class wspp_client : public _websocket_client_impl, public std::enable_shared_fro
675
664
bool is_tls_client () const override { return true ; }
676
665
websocketpp::client<websocketpp::config::asio_tls_client> m_client;
677
666
};
678
- #endif
679
667
std::unique_ptr<websocketpp_client_base> m_client;
680
668
681
669
websocketpp::connection_hdl m_con;
0 commit comments