Websockets: use established NDEBUG - see assert(3)

This commit is contained in:
Robin Gareus 2020-02-24 22:03:01 +01:00
parent 17cd3853e0
commit bd00db9e8b
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 5 additions and 5 deletions

View file

@ -16,7 +16,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef DEBUG
#ifndef NDEBUG
#include <iostream>
#endif
@ -97,7 +97,7 @@ NodeStateMessage::NodeStateMessage (void* buf, size_t len)
_valid = true;
} catch (const std::exception& exc) {
#ifdef DEBUG
#ifndef NDEBUG
std::cerr << "cannot parse message - " << exc.what () << std::endl;
#endif
}

View file

@ -16,7 +16,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifdef DEBUG
#ifndef NDEBUG
#include <iostream>
#endif
@ -245,7 +245,7 @@ WebsocketsServer::recv_client (Client wsi, void* buf, size_t len)
return;
}
#ifdef DEBUG
#ifndef NDEBUG
std::cerr << "RX " << msg.state ().debug_str () << std::endl;
#endif
@ -282,7 +282,7 @@ WebsocketsServer::write_client (Client wsi)
size_t len = msg.serialize (out_buf + LWS_PRE, 1024 - LWS_PRE);
if (len > 0) {
#ifdef DEBUG
#ifndef NDEBUG
std::cerr << "TX " << msg.state ().debug_str () << std::endl;
#endif
lws_write (wsi, out_buf + LWS_PRE, len, LWS_WRITE_TEXT);