]> git.tdb.fi Git - libs/net.git/blobdiff - source/http/server.cpp
Use nullptr instead of 0 for pointers
[libs/net.git] / source / http / server.cpp
index c52bec4e7e89a2b3a703a657eecc88b102407788..a7435d330350b41e60416dbc3eb632d840b742ab 100644 (file)
@@ -18,13 +18,11 @@ namespace Msp {
 namespace Http {
 
 Server::Server():
-       sock(Net::INET6),
-       event_disp(0)
+       sock(Net::INET6)
 { }
 
 Server::Server(unsigned port):
-       sock(Net::INET6),
-       event_disp(0)
+       sock(Net::INET6)
 {
        listen(port);
 }
@@ -194,7 +192,7 @@ void Server::client_data_available(Client &cl)
                        else
                        {
                                responses.erase(cl.response);
-                               cl.response = 0;
+                               cl.response = nullptr;
                                if(response->get_status()==NONE)
                                {
                                        response = new Response(NOT_FOUND);
@@ -205,7 +203,7 @@ void Server::client_data_available(Client &cl)
                catch(const exception &e)
                {
                        responses.erase(cl.response);
-                       cl.response = 0;
+                       cl.response = nullptr;
                        response = new Response(INTERNAL_ERROR);
                        response->add_content(format("An error occurred while processing the request:\ntype: %s\nwhat: %s",
                                Debug::demangle(typeid(e).name()), e.what()));
@@ -235,9 +233,9 @@ void Server::send_response(Client &cl, Response &resp)
        if(cl.keepalive)
        {
                delete cl.request;
-               cl.request = 0;
+               cl.request = nullptr;
                delete cl.response;
-               cl.response = 0;
+               cl.response = nullptr;
        }
        else
        {
@@ -258,12 +256,7 @@ Server::Client &Server::get_client_by_response(Response &resp)
 
 
 Server::Client::Client(RefPtr<Net::StreamSocket> s):
-       sock(s),
-       request(0),
-       response(0),
-       keepalive(false),
-       async(false),
-       stale(false)
+       sock(s)
 { }
 
 Server::Client::~Client()