This change fixes a shutdown crash occuring when using an
external io_service to drive a websocketpp server. The crash
itself is reproduced by the following code:
```
int main(int argc, const char * argv[])
{
boost::asio::io_service ioService;
std::unique_ptr<boost::asio::io_service::work> ioServiceWork(new boost::asio::io_service::work(ioService));
std::thread ioServiceThread(boost::bind(&boost::asio::io_service::run, &ioService));
{
auto server = std::unique_ptr<websocketpp::server<websocketpp::config::asio>>(new websocketpp::server<websocketpp::config::asio>());
server->init_asio(&ioService);
server->listen(0);
server->start_accept();
server->stop();
}
ioServiceWork.reset();
ioService.stop();
ioServiceThread.join();
return 0;
}
```
The cause of the crash is a dangling pointer to alog or elog objects in endpoints.
This is mitigated by storing logging objects as shared_ptrs. This ensures that
they are kept alive and able to log even if their owning structures have already
been deallocated.
WebSocket++ (0.8.0-dev)
WebSocket++ is a header only C++ library that implements RFC6455 The WebSocket Protocol. It allows integrating WebSocket client and server functionality into C++ programs. It uses interchangeable network transport modules including one based on raw char buffers, one based on C++ iostreams, and one based on Asio (either via Boost or standalone). End users can write additional transport policies to support other networking or event libraries as needed.
Major Features
- Full support for RFC6455
- Partial support for Hixie 76 / Hybi 00, 07-17 draft specs (server only)
- Message/event based interface
- Supports secure WebSockets (TLS), IPv6, and explicit proxies.
- Flexible dependency management (C++11 Standard Library or Boost)
- Interchangeable network transport modules (raw, iostream, Asio, or custom)
- Portable/cross platform (Posix/Windows, 32/64bit, Intel/ARM/PPC)
- Thread-safe
Get Involved
Project Website http://www.zaphoyd.com/websocketpp/
User Manual http://www.zaphoyd.com/websocketpp/manual/
GitHub Repository https://github.com/zaphoyd/websocketpp/
GitHub pull requests should be submitted to the develop branch.
Announcements Mailing List http://groups.google.com/group/websocketpp-announcements/
IRC Channel #websocketpp (freenode)
Discussion / Development / Support Mailing List / Forum http://groups.google.com/group/websocketpp/
Author
Peter Thorson - websocketpp@zaphoyd.com
