From: Christian Hofstaedtler Date: Tue, 25 Mar 2014 17:15:17 +0000 (+0100) Subject: Move zombie session.(cc|hh) to webserver.hh X-Git-Tag: rec-3.6.0-rc1~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7650f236ccf0d494add5ce17cc23ea1e0d2ec89;p=thirdparty%2Fpdns.git Move zombie session.(cc|hh) to webserver.hh --- diff --git a/pdns/Makefile.am b/pdns/Makefile.am index 7db34f728c..055224cdf5 100644 --- a/pdns/Makefile.am +++ b/pdns/Makefile.am @@ -46,7 +46,7 @@ dns.hh dnsbackend.hh dnsbackend.cc dnspacket.hh dynmessenger.hh lock.hh logger.h nameserver.hh packetcache.hh packethandler.hh qtype.hh statbag.hh \ ueberbackend.hh pdns.conf-dist \ ws-auth.hh ws-auth.cc ws-api.cc ws-api.hh webserver.cc webserver.hh \ -session.cc session.hh misc.cc misc.hh receiver.cc ueberbackend.cc \ +misc.cc misc.hh receiver.cc ueberbackend.cc \ dynlistener.cc dynlistener.hh dynhandler.cc dynhandler.hh \ resolver.hh resolver.cc slavecommunicator.cc mastercommunicator.cc communicator.cc communicator.hh dnsproxy.cc \ dnsproxy.hh unix_utility.cc common_startup.cc \ @@ -293,7 +293,7 @@ dns_random.cc \ lua-pdns.cc lua-pdns.hh lua-recursor.cc lua-recursor.hh randomhelper.cc \ recpacketcache.cc recpacketcache.hh dns.cc nsecrecords.cc base32.cc cachecleaner.hh \ ws-recursor.cc ws-recursor.hh ws-api.cc ws-api.hh webserver.cc webserver.hh \ -session.cc session.hh json.cc json.hh version.hh version.cc responsestats.cc +json.cc json.hh version.hh version.cc responsestats.cc pdns_recursor_LDFLAGS= $(LUA_LIBS) pdns_recursor_LDADD= $(POLARSSL_LIBS) $(YAHTTP_LIBS) diff --git a/pdns/communicator.cc b/pdns/communicator.cc index 34be6a54cb..40aa9e1b55 100644 --- a/pdns/communicator.cc +++ b/pdns/communicator.cc @@ -32,7 +32,6 @@ #include "logger.hh" #include "dns.hh" #include "arguments.hh" -#include "session.hh" #include "packetcache.hh" #include diff --git a/pdns/dist-recursor b/pdns/dist-recursor index ed0a328050..5706840846 100755 --- a/pdns/dist-recursor +++ b/pdns/dist-recursor @@ -27,7 +27,7 @@ mplexer.hh \ dns_random.hh lua-pdns.hh lua-recursor.hh namespaces.hh \ recpacketcache.hh base32.hh cachecleaner.hh json.hh version.hh \ ws-recursor.hh ws-api.hh \ -responsestats.hh webserver.hh session.hh" +responsestats.hh webserver.hh" CFILES="syncres.cc misc.cc unix_utility.cc qtype.cc \ logger.cc arguments.cc lwres.cc pdns_recursor.cc \ @@ -37,7 +37,7 @@ selectmplexer.cc epollmplexer.cc kqueuemplexer.cc portsmplexer.cc pdns_hw.cc \ sillyrecords.cc lua-pdns.cc lua-recursor.cc randomhelper.cc \ devpollmplexer.cc recpacketcache.cc dns.cc reczones.cc base32.cc nsecrecords.cc \ dnslabeltext.cc json.cc ws-recursor.cc ws-api.cc version.cc dns_random.cc \ -responsestats.cc webserver.cc session.cc" +responsestats.cc webserver.cc" cd docs make pdns_recursor.1 rec_control.1 diff --git a/pdns/mastercommunicator.cc b/pdns/mastercommunicator.cc index 8da8dade3a..047252233f 100644 --- a/pdns/mastercommunicator.cc +++ b/pdns/mastercommunicator.cc @@ -34,7 +34,6 @@ #include "logger.hh" #include "dns.hh" #include "arguments.hh" -#include "session.hh" #include "packetcache.hh" #include diff --git a/pdns/session.cc b/pdns/session.cc deleted file mode 100644 index ce7ac432de..0000000000 --- a/pdns/session.cc +++ /dev/null @@ -1,37 +0,0 @@ -/* - PowerDNS Versatile Database Driven Nameserver - Copyright (C) 2002 - 2014 PowerDNS.COM BV - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 - as published by the Free Software Foundation - - Additionally, the license of this program contains a special - exception which allows to distribute the program in binary form when - it is linked against OpenSSL. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#include "utility.hh" -#include "session.hh" -#include "pdnsexception.hh" -#include "misc.hh" -#include -#include -#include -#include -#include -#include "misc.hh" -#include "iputils.hh" - -Socket* Server::accept() -{ - return d_server_socket.accept(); -} diff --git a/pdns/session.hh b/pdns/session.hh deleted file mode 100644 index 7a32a3853e..0000000000 --- a/pdns/session.hh +++ /dev/null @@ -1,62 +0,0 @@ -/* - PowerDNS Versatile Database Driven Nameserver - Copyright (C) 2002 - 2014 PowerDNS.COM BV - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License version 2 - as published by the Free Software Foundation - - Additionally, the license of this program contains a special - exception which allows to distribute the program in binary form when - it is linked against OpenSSL. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#ifndef SESSION_HH -#define SESSION_HH - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "sstuff.hh" -#include "iputils.hh" -#include "mplexer.hh" -#include "syncres.hh" - - -//! The server class can be used to create listening servers -class Server -{ -public: - Server(const string &localaddress, int port) : d_local(localaddress.empty() ? "0.0.0.0" : localaddress, port), d_server_socket(InterNetwork, Stream, 0) { - d_server_socket.setReuseAddr(); - d_server_socket.bind(d_local); - d_server_socket.listen(); - } - - ComboAddress d_local; - - Socket *accept(); //!< Call accept() in an endless loop to accept new connections - -protected: - Socket d_server_socket; -}; - -#endif /* SESSION_HH */ diff --git a/pdns/slavecommunicator.cc b/pdns/slavecommunicator.cc index 0dc932eb1b..9ccbdbc553 100644 --- a/pdns/slavecommunicator.cc +++ b/pdns/slavecommunicator.cc @@ -35,7 +35,6 @@ #include "logger.hh" #include "dns.hh" #include "arguments.hh" -#include "session.hh" #include "packetcache.hh" #include #include diff --git a/pdns/webserver.cc b/pdns/webserver.cc index 09a177403a..478dcfd3ff 100644 --- a/pdns/webserver.cc +++ b/pdns/webserver.cc @@ -21,7 +21,6 @@ */ #include "utility.hh" #include "webserver.hh" -#include "session.hh" #include "misc.hh" #include #include "logger.hh" diff --git a/pdns/webserver.hh b/pdns/webserver.hh index 1c046420b6..f627376b55 100644 --- a/pdns/webserver.hh +++ b/pdns/webserver.hh @@ -31,7 +31,6 @@ #include "rapidjson/writer.h" #include "namespaces.hh" #include "sstuff.hh" -#include "session.hh" class HttpRequest : public YaHTTP::Request { public: @@ -106,6 +105,25 @@ public: } }; +class Server +{ +public: + Server(const string &localaddress, int port) : d_local(localaddress.empty() ? "0.0.0.0" : localaddress, port), d_server_socket(InterNetwork, Stream, 0) { + d_server_socket.setReuseAddr(); + d_server_socket.bind(d_local); + d_server_socket.listen(); + } + + ComboAddress d_local; + + Socket *accept() { + return d_server_socket.accept(); + } + +protected: + Socket d_server_socket; +}; + class WebServer : public boost::noncopyable { public: diff --git a/pdns/ws-recursor.hh b/pdns/ws-recursor.hh index a8052a5378..ffcad30636 100644 --- a/pdns/ws-recursor.hh +++ b/pdns/ws-recursor.hh @@ -22,7 +22,6 @@ #include #include "namespaces.hh" #include "mplexer.hh" -#include "session.hh" #include "webserver.hh" class HttpRequest;