]> git.tdb.fi Git - libs/net.git/blobdiff - source/http/server.h
Use nullptr instead of 0 for pointers
[libs/net.git] / source / http / server.h
index dd054201d1bf421e136a97c4c2365e8f408cac70..e6de22781d17077a8e26a66925231780de4c518d 100644 (file)
@@ -4,6 +4,7 @@
 #include <msp/core/refptr.h>
 #include <msp/io/eventdispatcher.h>
 #include <msp/net/streamserversocket.h>
+#include <msp/time/timedelta.h>
 
 namespace Msp {
 namespace Http {
@@ -21,11 +22,11 @@ private:
        {
                RefPtr<Net::StreamSocket> sock;
                std::string in_buf;
-               Request *request;
-               Response *response;
-               bool keepalive;
-               bool async;
-               bool stale;
+               Request *request = nullptr;
+               Response *response = nullptr;
+               bool keepalive = false;
+               bool async = false;
+               bool stale = false;
 
                Client(RefPtr<Net::StreamSocket>);
                ~Client();
@@ -34,7 +35,7 @@ private:
        Net::StreamServerSocket sock;
        std::list<Client> clients;
        std::map<Response *, Client *> responses;
-       IO::EventDispatcher *event_disp;
+       IO::EventDispatcher *event_disp = nullptr;
 
 public:
        Server();
@@ -47,6 +48,7 @@ public:
        void delay_response(Response &);
        void submit_response(Response &);
        void cancel_keepalive(Response &);
+       void close_connections(const Time::TimeDelta &);
 private:
        void data_available();
        void client_data_available(Client &);