]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
Merge branch 'work/sock/cppclient' into scfinal
authorMichal 'vorner' Vaner <michal.vaner@nic.cz>
Thu, 5 Jan 2012 08:41:50 +0000 (09:41 +0100)
committerMichal 'vorner' Vaner <michal.vaner@nic.cz>
Thu, 5 Jan 2012 08:41:50 +0000 (09:41 +0100)
1  2 
src/bin/auth/tests/auth_srv_unittest.cc
src/bin/resolver/main.cc
src/bin/resolver/tests/resolver_config_unittest.cc
src/lib/asiodns/dns_service.cc
src/lib/asiodns/io_fetch.cc
src/lib/asiodns/tcp_server.cc
src/lib/asiodns/tests/dns_server_unittest.cc
src/lib/asiodns/udp_server.cc
src/lib/asiodns/udp_server.h
src/lib/server_common/portconfig.cc

Simple merge
index 63d75c2bac3288d155d51982a4dc2eb82754c3a1,87d4826dfc540e65fa37ffc58e9f6489dfac85d9..a381abfdba04bf22a8dbab17ca62091d60ceefd6
@@@ -81,8 -62,12 +82,11 @@@ protected
      scoped_ptr<const IOMessage> query_message;
      scoped_ptr<const Client> client;
      scoped_ptr<const RequestContext> request;
-     ResolverConfig() : dnss(ios, NULL, NULL, NULL) {
+     ResolverConfig() :
+         dnss(ios, NULL, NULL, NULL),
+         sock_requestor_(dnss, address_store_, 53210)
+     {
          server.setDNSService(dnss);
 -        server.setConfigured();
      }
      const RequestContext& createRequest(const string& source_addr) {
          endpoint.reset(IOEndpoint::create(IPPROTO_UDP, IOAddress(source_addr),
Simple merge
Simple merge
index 2606a21aa9ece582382c68c63e0d905054eba94e,b351f71ee91c88f4f1f272b4feb663cf0483a4b8..d116bdbe0b7c7c97253e86561284f7531fec3bd3
@@@ -69,8 -69,33 +69,33 @@@ TCPServer::TCPServer(io_service& io_ser
      acceptor_->listen();
  }
  
+ TCPServer::TCPServer(io_service& io_service, int fd, int af,
+                      const SimpleCallback* checkin,
+                      const DNSLookup* lookup,
+                      const DNSAnswer* answer) :
+     io_(io_service), done_(false),
+     checkin_callback_(checkin), lookup_callback_(lookup),
+     answer_callback_(answer)
+ {
+     if (af != AF_INET && af != AF_INET6) {
+         isc_throw(InvalidParameter, "Address family must be either AF_INET "
+                   "or AF_INET6, not " << af);
+     }
+     LOG_DEBUG(logger, DBGLVL_TRACE_BASIC, ASIODNS_FD_ADD_TCP).arg(fd);
+     try {
+         acceptor_.reset(new tcp::acceptor(io_service));
+         acceptor_->assign(af == AF_INET6 ? tcp::v6() : tcp::v4(), fd);
+         acceptor_->listen();
+     } catch (const std::exception& exception) {
+         // Whatever the thing throws, it is something from ASIO and we convert
+         // it
+         isc_throw(IOError, exception.what());
+     }
+ }
  void
 -TCPServer::operator()(error_code ec, size_t length) {
 +TCPServer::operator()(asio::error_code ec, size_t length) {
      /// Because the coroutine reentry block is implemented as
      /// a switch statement, inline variable declarations are not
      /// permitted.  Certain variables used below can be declared here.
Simple merge
Simple merge
Simple merge