summaryrefslogtreecommitdiffstats
path: root/src/uscxml/server/HTTPServer.cpp
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-01-14 16:15:09 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-01-14 16:15:09 (GMT)
commit836927aa902696297febc95132e2c82147c08c03 (patch)
tree64bcbaa67c6f70acdb5f4cc9184f600fad46b826 /src/uscxml/server/HTTPServer.cpp
parentf7ca1ebaa5a527f817892bc3794452df1a6c20c6 (diff)
downloaduscxml-836927aa902696297febc95132e2c82147c08c03.zip
uscxml-836927aa902696297febc95132e2c82147c08c03.tar.gz
uscxml-836927aa902696297febc95132e2c82147c08c03.tar.bz2
Expect Invoker and Fedora build fixes
Diffstat (limited to 'src/uscxml/server/HTTPServer.cpp')
-rw-r--r--src/uscxml/server/HTTPServer.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/uscxml/server/HTTPServer.cpp b/src/uscxml/server/HTTPServer.cpp
index de78ba9..804b025 100644
--- a/src/uscxml/server/HTTPServer.cpp
+++ b/src/uscxml/server/HTTPServer.cpp
@@ -77,6 +77,12 @@ HTTPServer::HTTPServer(unsigned short port, unsigned short wsPort, SSLConfig* ss
_httpHandle = NULL;
_wsHandle = NULL;
+#ifdef _WIN32
+ _wsHandle = NULL;
+#else
+ _wsHandle = 0;
+#endif
+
determineAddress();
unsigned int allowedMethods =
@@ -525,6 +531,10 @@ void HTTPServer::replyCallback(evutil_socket_t fd, short what, void *arg) {
bool HTTPServer::registerServlet(const std::string& path, HTTPServlet* servlet) {
HTTPServer* INSTANCE = getInstance();
+
+ if (!INSTANCE->_httpHandle)
+ return true;
+
tthread::lock_guard<tthread::recursive_mutex> lock(INSTANCE->_mutex);
// remove trailing and leading slash
@@ -560,6 +570,10 @@ bool HTTPServer::registerServlet(const std::string& path, HTTPServlet* servlet)
bool HTTPServer::registerServlet(const std::string& path, WebSocketServlet* servlet) {
HTTPServer* INSTANCE = getInstance();
+
+ if (!INSTANCE->_wsHandle)
+ return true;
+
tthread::lock_guard<tthread::recursive_mutex> lock(INSTANCE->_mutex);
// remove trailing and leading slash