Commit 6341a708 authored by Jelte Jansen's avatar Jelte Jansen
Browse files

oops, forgot ifdef BOOST_LIB for that io_service

also fixed command handling and shutdown for non-boost version

git-svn-id: svn:// e5f2f494-b856-4b98-b285-d166d9295462
parent 5f05261c
......@@ -73,9 +73,13 @@ const char* DNSPORT = "5300";
* class itself? */
namespace {
AuthSrv *auth_server;
// TODO: this should be a property of AuthSrv, and AuthSrv needs
// a stop() method (so the shutdown command can be handled)
boost::asio::io_service io_service_;
bool running;
static ElementPtr
......@@ -92,7 +96,11 @@ my_command_handler(const string& command, const ElementPtr args) {
/* let's add that message to our answer as well */
} else if (command == "shutdown") {
running = false;
return answer;
......@@ -555,9 +563,11 @@ run_server(const char* port, const bool use_ipv4, const bool use_ipv6,
OutputBuffer resonse_buffer(0);
MessageRenderer response_renderer(resonse_buffer);
while (true) {
running = true;
while (running) {
fd_set fds = fds_base;
FD_SET(ss, &fds);
int n = select(nfds, &fds, NULL, NULL, NULL);
if (n < 0) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment