diff options
author | lloyd <[email protected]> | 2012-02-20 18:35:02 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-02-20 18:35:02 +0000 |
commit | 73e7730306b524aeee6fcfe8dd9f41b9673cf31b (patch) | |
tree | ded41f30316a7eb17b7e80c9b92351d457c753f0 /doc/examples/tls_server.cpp | |
parent | 7fb2de6b49d8bf42ede7b4dfda7c358bb67e5c9f (diff) |
Fix examples. Use crazy hack of compiling asio tls server using 4.6.0
but linking using 4.7.0 - asio seems to have problems with the 4.7.0
libstdc++ in C++11 mode, mostly related to missing noexcept and trying
to copy things that are move only.
Diffstat (limited to 'doc/examples/tls_server.cpp')
-rw-r--r-- | doc/examples/tls_server.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/doc/examples/tls_server.cpp b/doc/examples/tls_server.cpp index a5f2c5d78..6bbcfd8b5 100644 --- a/doc/examples/tls_server.cpp +++ b/doc/examples/tls_server.cpp @@ -12,7 +12,7 @@ using namespace Botan; -using namespace std::tr1::placeholders; +using namespace std::placeholders; #include <stdio.h> #include <string> @@ -33,8 +33,8 @@ bool handshake_complete(const TLS::Session& session) class Blocking_TLS_Server { public: - Blocking_TLS_Server(std::tr1::function<void (const byte[], size_t)> output_fn, - std::tr1::function<size_t (byte[], size_t)> input_fn, + Blocking_TLS_Server(std::function<void (const byte[], size_t)> output_fn, + std::function<size_t (byte[], size_t)> input_fn, std::vector<std::string>& protocols, TLS::Session_Manager& sessions, Credentials_Manager& creds, @@ -43,7 +43,7 @@ class Blocking_TLS_Server input_fn(input_fn), server( output_fn, - std::tr1::bind(&Blocking_TLS_Server::reader_fn, std::tr1::ref(*this), _1, _2, _3), + std::bind(&Blocking_TLS_Server::reader_fn, std::ref(*this), _1, _2, _3), handshake_complete, sessions, creds, @@ -119,7 +119,7 @@ class Blocking_TLS_Server read_queue.write(buf, buf_len); } - std::tr1::function<size_t (byte[], size_t)> input_fn; + std::function<size_t (byte[], size_t)> input_fn; TLS::Server server; SecureQueue read_queue; bool exit; @@ -161,8 +161,8 @@ int main(int argc, char* argv[]) printf("Got new connection\n"); Blocking_TLS_Server tls( - std::tr1::bind(&Socket::write, std::tr1::ref(sock), _1, _2), - std::tr1::bind(&Socket::read, std::tr1::ref(sock), _1, _2, true), + std::bind(&Socket::write, std::ref(sock), _1, _2), + std::bind(&Socket::read, std::ref(sock), _1, _2, true), protocols, sessions, creds, |