Remove most debug prints
This commit is contained in:
+2
-10
@@ -33,7 +33,6 @@ namespace uWS {
|
|||||||
struct Loop {
|
struct Loop {
|
||||||
private:
|
private:
|
||||||
static void wakeupCb(us_loop *loop) {
|
static void wakeupCb(us_loop *loop) {
|
||||||
//std::cout << "wakeupCB called" << std::endl;
|
|
||||||
LoopData *loopData = (LoopData *) us_loop_ext(loop);
|
LoopData *loopData = (LoopData *) us_loop_ext(loop);
|
||||||
|
|
||||||
/* Swap current deferQueue */
|
/* Swap current deferQueue */
|
||||||
@@ -66,10 +65,7 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
Loop() = delete;
|
Loop() = delete;
|
||||||
|
~Loop() = default;
|
||||||
~Loop() {
|
|
||||||
std::cout << "Loop destructor called" << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Loop *init() {
|
Loop *init() {
|
||||||
new (us_loop_ext((us_loop *) this)) LoopData;
|
new (us_loop_ext((us_loop *) this)) LoopData;
|
||||||
@@ -111,8 +107,6 @@ public:
|
|||||||
LoopData *loopData = (LoopData *) us_loop_ext((us_loop *) this);
|
LoopData *loopData = (LoopData *) us_loop_ext((us_loop *) this);
|
||||||
loopData->~LoopData();
|
loopData->~LoopData();
|
||||||
us_loop_free((us_loop *) this);
|
us_loop_free((us_loop *) this);
|
||||||
|
|
||||||
std::cout << "Loop::free" << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set postCb callback */
|
/* Set postCb callback */
|
||||||
@@ -132,13 +126,11 @@ public:
|
|||||||
void defer(std::function<void()> cb) {
|
void defer(std::function<void()> cb) {
|
||||||
LoopData *loopData = (LoopData *) us_loop_ext((us_loop *) this);
|
LoopData *loopData = (LoopData *) us_loop_ext((us_loop *) this);
|
||||||
|
|
||||||
//std::cout << "defer called" << std::endl;
|
|
||||||
//if (std::thread::get_id() == ) // todo: add fast path for same thread id
|
//if (std::thread::get_id() == ) // todo: add fast path for same thread id
|
||||||
loopData->deferMutex.lock();
|
loopData->deferMutex.lock();
|
||||||
loopData->deferQueues[loopData->currentDeferQueue].emplace_back(cb);
|
loopData->deferQueues[loopData->currentDeferQueue].emplace_back(cb);
|
||||||
loopData->deferMutex.unlock();
|
loopData->deferMutex.unlock();
|
||||||
|
|
||||||
//std::cout << "us_wakeup_loop called" << std::endl;
|
|
||||||
us_wakeup_loop((us_loop *) this);
|
us_wakeup_loop((us_loop *) this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -150,7 +142,7 @@ public:
|
|||||||
/* Passively integrate with the underlying default loop */
|
/* Passively integrate with the underlying default loop */
|
||||||
/* Used to seamlessly integrate with third parties such as Node.js */
|
/* Used to seamlessly integrate with third parties such as Node.js */
|
||||||
void integrate() {
|
void integrate() {
|
||||||
|
us_loop_integrate((us_loop *) this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,6 @@ struct DeflationStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
~DeflationStream() {
|
~DeflationStream() {
|
||||||
std::cout << "Destructing DeflationStream" << std::endl;
|
|
||||||
deflateEnd(&deflationStream);
|
deflateEnd(&deflationStream);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -124,7 +123,6 @@ struct InflationStream {
|
|||||||
}
|
}
|
||||||
|
|
||||||
~InflationStream() {
|
~InflationStream() {
|
||||||
std::cout << "Destructing inflationstream" << std::endl;
|
|
||||||
inflateEnd(&inflationStream);
|
inflateEnd(&inflationStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -237,8 +237,6 @@ private:
|
|||||||
/* Handle socket disconnections */
|
/* Handle socket disconnections */
|
||||||
static_dispatch(us_ssl_socket_context_on_close, us_socket_context_on_close)(getSocketContext(), [](auto *s) {
|
static_dispatch(us_ssl_socket_context_on_close, us_socket_context_on_close)(getSocketContext(), [](auto *s) {
|
||||||
|
|
||||||
//std::cout << "close!" << std::endl;
|
|
||||||
|
|
||||||
WebSocketData *webSocketData = (WebSocketData *) (static_dispatch(us_ssl_socket_ext, us_socket_ext)(s));
|
WebSocketData *webSocketData = (WebSocketData *) (static_dispatch(us_ssl_socket_ext, us_socket_ext)(s));
|
||||||
webSocketData->~WebSocketData();
|
webSocketData->~WebSocketData();
|
||||||
|
|
||||||
@@ -345,8 +343,6 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void free() {
|
void free() {
|
||||||
std::cout << "websocket context free" << std::endl;
|
|
||||||
|
|
||||||
WebSocketContextData<SSL> *webSocketContextData = (WebSocketContextData<SSL> *) static_dispatch(us_ssl_socket_context_ext, us_socket_context_ext)((SOCKET_CONTEXT_TYPE *) this);
|
WebSocketContextData<SSL> *webSocketContextData = (WebSocketContextData<SSL> *) static_dispatch(us_ssl_socket_context_ext, us_socket_context_ext)((SOCKET_CONTEXT_TYPE *) this);
|
||||||
webSocketContextData->~WebSocketContextData();
|
webSocketContextData->~WebSocketContextData();
|
||||||
|
|
||||||
|
|||||||
@@ -53,8 +53,6 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
~WebSocketData() {
|
~WebSocketData() {
|
||||||
std::cout << "destruting webocketdata" << std::endl;
|
|
||||||
|
|
||||||
if (deflationStream) {
|
if (deflationStream) {
|
||||||
delete deflationStream;
|
delete deflationStream;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user