summaryrefslogtreecommitdiff
path: root/util/miniwebserver.h
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-04-01 12:26:31 -0400
committerAaron <aaron@10gen.com>2009-04-01 12:26:31 -0400
commited35b0874ccd6462dd9b24d57c3657ade812a1d9 (patch)
tree5cf07bb825db6d9697978e0a9eda47012ea8e44a /util/miniwebserver.h
parentd39de1e40758bc0201fd332ce3761529c7a952d2 (diff)
downloadmongo-ed35b0874ccd6462dd9b24d57c3657ade812a1d9.tar.gz
Close listener sockets on exit
Diffstat (limited to 'util/miniwebserver.h')
-rw-r--r--util/miniwebserver.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/util/miniwebserver.h b/util/miniwebserver.h
index 579e6f59b37..fdeead967dd 100644
--- a/util/miniwebserver.h
+++ b/util/miniwebserver.h
@@ -27,7 +27,7 @@ namespace mongo {
MiniWebServer();
virtual ~MiniWebServer() {}
- bool init(int port);
+ bool init(int _port);
void run();
virtual void doRequest(
@@ -39,7 +39,8 @@ namespace mongo {
vector<string>& headers // if completely empty, content-type: text/html will be added
) = 0;
-
+ int socket() const { return sock; }
+
protected:
string parseURL( const char * buf );
string parseMethod( const char * headers );
@@ -51,6 +52,7 @@ namespace mongo {
void accepted(int s);
static bool fullReceive( const char *buf );
+ int port;
int sock;
};