From 0e3c3380d519b033500b4ed1ccd3acf707c34372 Mon Sep 17 00:00:00 2001 From: Vegard Storheil Eriksen Date: Sun, 2 Jan 2011 22:28:26 +0100 Subject: Merge HTTPResponse into HTTP::Connection. --- main.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index ebe3554..1099960 100644 --- a/main.cpp +++ b/main.cpp @@ -13,18 +13,11 @@ void foo_handler(HTTP::Connection::p connection) { std::cout << "Handling!" << std::endl; - HTTPResponse res(connection->socket); - - //MusicListing::p ml = music::get(connection->path); - bool ml = 0; + MusicListing::p ml = music::get(connection->path); if(ml) { - res.code = 200; - res.status = "OK"; - - //ml->render(connection, res); + ml->render(connection); } else { - res.code = 404; - res.status = "Not Found"; + connection->send_error(404, "Not Found"); } } -- cgit v1.2.3