1
0
mirror of https://github.com/lammertb/libhttp.git synced 2025-08-10 14:23:00 +03:00

Fix use of std::vector in optional C++ interface (see #262)

This commit is contained in:
bel
2016-02-19 23:12:30 +01:00
parent 4d5de1ce6f
commit 58ca276782
2 changed files with 9 additions and 3 deletions

View File

@@ -251,11 +251,16 @@ class FooHandler : public CivetHandler
int
main(int argc, char *argv[])
{
const char *options[] = {
"document_root", DOCUMENT_ROOT, "listening_ports", PORT, 0};
std::vector<std::string> cpp_options;
for (int i=0; i<(sizeof(options)/sizeof(options[0])-1); i++) {
cpp_options.push_back(options[i]);
}
CivetServer server(options);
// CivetServer server(options); // <-- C style start
CivetServer server(cpp_options); // <-- C++ style start
ExampleHandler h_ex;
server.addHandler(EXAMPLE_URI, h_ex);