blob: 683016c9758e704f2cb3c278e252e7fd164ecaad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
// file : brep/search.cxx -*- C++ -*-
// copyright : Copyright (c) 2014-2015 Code Synthesis Tools CC
// license : MIT; see accompanying LICENSE file
#include <brep/search>
#include <ostream>
using namespace std;
namespace brep
{
void search::
handle (request& rq, response& rs)
{
MODULE_DIAG;
const name_values& ps (rq.parameters ());
if (ps.empty ())
throw invalid_request ("search parameters expected");
if (ps.size () > 100)
fail << "too many parameters: " << ps.size () <<
info << "are you crazy to specify so many?";
info << "handling search request from "; // << rq.client_ip ();
level2 ([&]{trace << "search request with " << ps.size () << " params";});
ostream& o (rs.content (202, "text/html;charset=utf-8"));
o << "Search page:" << endl;
for (const name_value& p: ps)
{
o << p.name << "=" << p.value << endl;
}
}
}
|