diff options
author | unknown <Administrator@.(none)> | 2008-11-29 20:01:58 -0500 |
---|---|---|
committer | unknown <Administrator@.(none)> | 2008-11-29 20:01:58 -0500 |
commit | dfb8f562ae762d1096205c14464dc41f87643732 (patch) | |
tree | d83ac38db99509e030c11ed780ba3321e2772d4a /util/miniwebserver.h | |
parent | cc1c365abd74c4b04bbb466e71a744b37af26682 (diff) | |
download | mongo-dfb8f562ae762d1096205c14464dc41f87643732.tar.gz |
web console beginnings
Diffstat (limited to 'util/miniwebserver.h')
-rw-r--r-- | util/miniwebserver.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/util/miniwebserver.h b/util/miniwebserver.h new file mode 100644 index 00000000000..60bf69a1ec1 --- /dev/null +++ b/util/miniwebserver.h @@ -0,0 +1,43 @@ +// miniwebserver.h + +/** +* Copyright (C) 2008 10gen Inc. +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU Affero General Public License, version 3, +* as published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Affero General Public License for more details. +* +* You should have received a copy of the GNU Affero General Public License +* along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#pragma once + +#include "../grid/message.h" + +class MiniWebServer { +public: + MiniWebServer(); + + bool init(int port); + void run(); + + virtual void doRequest( + const char *rq, // the full request + string url, + // set these and return them: + string& responseMsg, + int& responseCode, + vector<string>& headers // if completely empty, content-type: text/html will be added + ) = 0; + +private: + void accepted(int s); + + int sock; +}; |