X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fhttp%2Fserver.cpp;h=a7435d330350b41e60416dbc3eb632d840b742ab;hb=3ab65d35cfd696002e09768a38f98e6a2e1ade81;hp=c52bec4e7e89a2b3a703a657eecc88b102407788;hpb=dd1884f1aaef4df246d78cabc9d937e5ebc3e511;p=libs%2Fnet.git diff --git a/source/http/server.cpp b/source/http/server.cpp index c52bec4..a7435d3 100644 --- a/source/http/server.cpp +++ b/source/http/server.cpp @@ -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 s): - sock(s), - request(0), - response(0), - keepalive(false), - async(false), - stale(false) + sock(s) { } Server::Client::~Client()