From 4958ba98e66af264e1f03f5dbacc713e51cd437d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Tue, 10 Jul 2012 20:05:05 +0200 Subject: include our usual config.h in the webserver --- test/interactive-helper/aptwebserver.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'test/interactive-helper') diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc index 0b2720dad..0780288a4 100644 --- a/test/interactive-helper/aptwebserver.cc +++ b/test/interactive-helper/aptwebserver.cc @@ -1,3 +1,5 @@ +#include + #include #include #include @@ -88,7 +90,7 @@ void addDataHeaders(std::list &headers, std::string &data) {/*{{{*/ } /*}}}*/ bool sendHead(int const client, int const httpcode, std::list &headers) { /*{{{*/ - string response("HTTP/1.1 "); + std::string response("HTTP/1.1 "); response.append(httpcodeToStr(httpcode)); headers.push_front(response); @@ -131,9 +133,9 @@ bool sendData(int const client, std::string const &data) { /*{{{*/ return Success; } /*}}}*/ -void sendError(int const client, int const httpcode, string const &request, bool content) { /*{{{*/ +void sendError(int const client, int const httpcode, std::string const &request, bool content) { /*{{{*/ std::list headers; - string response(""); + std::string response("<html><head><title>"); response.append(httpcodeToStr(httpcode)).append(""); response.append("

").append(httpcodeToStr(httpcode)).append(""); @@ -181,7 +183,7 @@ int grouped_alpha_case_sort(const struct dirent **a, const struct dirent **b) { } return strcasecmp((*a)->d_name, (*b)->d_name); } -void sendDirectoryListing(int const client, string const &dir, string const &request, bool content) { +void sendDirectoryListing(int const client, std::string const &dir, std::string const &request, bool content) { std::list headers; std::ostringstream listing; @@ -306,12 +308,12 @@ int main(int const argc, const char * argv[]) } size_t const filestart = m->find(' ', 5); - string filename = m->substr(5, filestart - 5); + std::string filename = m->substr(5, filestart - 5); if (filename.empty() == true) filename = "."; if (simulate_broken_server == true) { - string data("ni ni ni\n"); + std::string data("ni ni ni\n"); addDataHeaders(headers, data); sendHead(client, 200, headers); sendData(client, data); -- cgit v1.2.3