summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2012-07-10 20:05:05 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2012-07-10 20:05:05 +0200
commit4958ba98e66af264e1f03f5dbacc713e51cd437d (patch)
treee46ebe02b7c17234bcbc4635140b268bdc9c6759 /test
parentd64053295c5544c62d7743c13bd415e42cf8f84d (diff)
include our usual config.h in the webserver
Diffstat (limited to 'test')
-rw-r--r--test/interactive-helper/aptwebserver.cc14
1 files changed, 8 insertions, 6 deletions
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 <config.h>
+
#include <apt-pkg/strutl.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/error.h>
@@ -88,7 +90,7 @@ void addDataHeaders(std::list<std::string> &headers, std::string &data) {/*{{{*/
}
/*}}}*/
bool sendHead(int const client, int const httpcode, std::list<std::string> &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<std::string> headers;
- string response("<html><head><title>");
+ std::string response("<html><head><title>");
response.append(httpcodeToStr(httpcode)).append("</title></head>");
response.append("<body><h1>").append(httpcodeToStr(httpcode)).append("</h1");
response.append("This error is a result of the request: <pre>");
@@ -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<std::string> 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);