X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fhttp%2Fserver.cpp;h=f0474fd18e993c57de16b1a3f51c07dc260f069f;hb=fa637ffb18421300e401a782d28dd729a3960ac4;hp=60d37c8f139b2b3ee3b344eb2220cbf89487b896;hpb=0aae7f2f585a48b21dbe818abcc14058afbdae97;p=libs%2Fnet.git diff --git a/source/http/server.cpp b/source/http/server.cpp index 60d37c8..f0474fd 100644 --- a/source/http/server.cpp +++ b/source/http/server.cpp @@ -66,6 +66,11 @@ void Server::submit_response(Response &resp) send_response(cl, *cl.response); } +void Server::cancel_keepalive(Response &resp) +{ + get_client_by_response(resp).keepalive = false; +} + void Server::data_available() { Net::StreamSocket *csock = sock.accept(); @@ -101,7 +106,7 @@ void Server::client_data_available(Client &cl) cl.request = new Request(Request::parse(cl.in_buf)); string addr_str = cl.sock->get_peer_address().str(); - unsigned colon = addr_str.find(':'); + string::size_type colon = addr_str.find(':'); cl.request->set_header("-Client-Host", addr_str.substr(0, colon)); if(cl.request->get_method()!="GET" && cl.request->get_method()!="POST")