-/* Copyright (c) 2013-2014 the Civetweb developers
+/* Copyright (c) 2013-2017 the Civetweb developers
* Copyright (c) 2013 No Face Press, LLC
*
* License http://opensource.org/licenses/mit-license.php MIT License
* @throws CivetException
*/
CivetServer(const char **options,
- const struct CivetCallbacks *callbacks = 0);
+ const struct CivetCallbacks *callbacks = 0,
+ const void *UserContext = 0);
CivetServer(std::vector<std::string> options,
- const struct CivetCallbacks *callbacks = 0);
+ const struct CivetCallbacks *callbacks = 0,
+ const void *UserContext = 0);
/**
* Destructor
std::string &dst,
bool append = false);
+ // generic user context which can be set/read,
+ // the server does nothing with this apart from keep it.
+ const void *
+ getUserContext() const
+ {
+ return UserContext;
+ }
+
protected:
class CivetConnection
{
struct mg_context *context;
std::map<struct mg_connection *, class CivetConnection> connections;
+ // generic user context which can be set/read,
+ // the server does nothing with this apart from keep it.
+ const void *UserContext;
+
private:
/**
* requestHandler(struct mg_connection *, void *cbdata)