Browse Source

Use asio's io_service for the msgq handling in auth as well. Needed to add a getter for the io_service to asio_link. This may very wel come under reconsideration for the next release, but it is needed right now to get it to work again ;)

(most likely refactor is to move the ModuleCCSession into the link or maybe even into AuthSrv itself)


git-svn-id: svn://bind10.isc.org/svn/bind10/trunk@2007 e5f2f494-b856-4b98-b285-d166d9295462
Jelte Jansen 15 years ago
parent
commit
f28f0da30a
3 changed files with 11 additions and 3 deletions
  1. 5 0
      src/bin/auth/asio_link.cc
  2. 1 0
      src/bin/auth/asio_link.h
  3. 5 3
      src/bin/auth/main.cc

+ 5 - 0
src/bin/auth/asio_link.cc

@@ -409,4 +409,9 @@ void
 IOService::stop() {
     impl_->io_service_.stop();
 }
+
+asio::io_service&
+IOService::get_io_service() {
+    return impl_->io_service_;
+}
 }

+ 1 - 0
src/bin/auth/asio_link.h

@@ -29,6 +29,7 @@ public:
     ~IOService();
     void run();
     void stop();
+    asio::io_service& get_io_service();
 private:
     IOServiceImpl* impl_;
 };

+ 5 - 3
src/bin/auth/main.cc

@@ -145,13 +145,15 @@ main(int argc, char* argv[]) {
         auth_server = new AuthSrv;
         auth_server->setVerbose(verbose_mode);
 
-        ModuleCCSession cs(specfile, my_config_handler, my_command_handler);
+        io_service = new asio_link::IOService(auth_server, port, use_ipv4,
+                                              use_ipv6);
+
+        ModuleCCSession cs(specfile, io_service->get_io_service(), my_config_handler, my_command_handler);
 
         auth_server->setConfigSession(&cs);
         auth_server->updateConfig(ElementPtr());
 
-        io_service = new asio_link::IOService(auth_server, port, use_ipv4,
-                                              use_ipv6);
+        
         cout << "[b10-auth] Server started." << endl;
         io_service->run();
     } catch (const std::exception& ex) {