|
@@ -269,11 +269,14 @@ CivetCallbacks::CivetCallbacks()
|
|
|
}
|
|
|
|
|
|
CivetServer::CivetServer(const char **options,
|
|
|
- const struct CivetCallbacks *_callbacks)
|
|
|
+ const struct CivetCallbacks *_callbacks,
|
|
|
+ const void *UserContextIn)
|
|
|
: context(0)
|
|
|
{
|
|
|
struct CivetCallbacks callbacks;
|
|
|
|
|
|
+ UserContext = UserContextIn;
|
|
|
+
|
|
|
if (_callbacks) {
|
|
|
callbacks = *_callbacks;
|
|
|
userCloseHandler = _callbacks->connection_close;
|
|
@@ -288,10 +291,13 @@ CivetServer::CivetServer(const char **options,
|
|
|
}
|
|
|
|
|
|
CivetServer::CivetServer(std::vector<std::string> options,
|
|
|
- const struct CivetCallbacks *_callbacks)
|
|
|
+ const struct CivetCallbacks *_callbacks,
|
|
|
+ const void *UserContextIn)
|
|
|
: context(0)
|
|
|
{
|
|
|
struct CivetCallbacks callbacks;
|
|
|
+
|
|
|
+ UserContext = UserContextIn;
|
|
|
|
|
|
if (_callbacks) {
|
|
|
callbacks = *_callbacks;
|
|
@@ -576,7 +582,7 @@ CivetServer::getListeningPorts()
|
|
|
std::vector<int> ports(50);
|
|
|
std::vector<struct mg_server_ports> server_ports(50);
|
|
|
int size =
|
|
|
- mg_get_server_ports(context, server_ports.size(), &server_ports[0]);
|
|
|
+ mg_get_server_ports(context, (int)server_ports.size(), &server_ports[0]);
|
|
|
if (size <= 0) {
|
|
|
ports.resize(0);
|
|
|
return ports;
|