diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2017-07-25 13:20:40 +0300 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2017-07-27 18:11:08 +0300 |
commit | 1b7372f2fb55f704b885e1097e2ec0381068c855 (patch) | |
tree | fe5ca729487cca97831c5bbd6edafd280a9c5814 /src/inspector_socket.cc | |
parent | 1fa67c7fc2ef9fc226545f5de22c51964dbc27e1 (diff) |
src: replace ASSERT with CHECK
Builds always have asserts enabled so there is no point distinguishing
between debug-only checks and run-time checks. Replace calls to ASSERT
and friends with their CHECK counterparts.
Fixes: https://github.com/nodejs/node/issues/14461
PR-URL: https://github.com/nodejs/node/pull/14474
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Nikolai Vavilov <vvnicholas@gmail.com>
Reviewed-By: XadillaX <admin@xcoder.in>
Diffstat (limited to 'src/inspector_socket.cc')
-rw-r--r-- | src/inspector_socket.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/inspector_socket.cc b/src/inspector_socket.cc index 85984b7fa11..2d5054bb802 100644 --- a/src/inspector_socket.cc +++ b/src/inspector_socket.cc @@ -157,7 +157,7 @@ static std::vector<char> encode_frame_hybi17(const char* message, } frame.insert(frame.end(), extended_payload_length, extended_payload_length + 8); - ASSERT_EQ(0, remaining); + CHECK_EQ(0, remaining); } frame.insert(frame.end(), message, message + data_length); return frame; @@ -361,8 +361,8 @@ static void websockets_data_cb(uv_stream_t* stream, ssize_t nread, int inspector_read_start(InspectorSocket* inspector, uv_alloc_cb alloc_cb, uv_read_cb read_cb) { - ASSERT(inspector->ws_mode); - ASSERT(!inspector->shutting_down || read_cb == nullptr); + CHECK(inspector->ws_mode); + CHECK(!inspector->shutting_down || read_cb == nullptr); inspector->ws_state->close_sent = false; inspector->ws_state->alloc_cb = alloc_cb; inspector->ws_state->read_cb = read_cb; @@ -561,7 +561,7 @@ static void init_handshake(InspectorSocket* socket) { int inspector_accept(uv_stream_t* server, InspectorSocket* socket, handshake_cb callback) { - ASSERT_NE(callback, nullptr); + CHECK_NE(callback, nullptr); CHECK_EQ(socket->http_parsing_state, nullptr); socket->http_parsing_state = new http_parsing_state_s(); @@ -597,8 +597,8 @@ void inspector_close(InspectorSocket* inspector, inspector_cb callback) { // libuv throws assertions when closing stream that's already closed - we // need to do the same. - ASSERT(!uv_is_closing(reinterpret_cast<uv_handle_t*>(&inspector->tcp))); - ASSERT(!inspector->shutting_down); + CHECK(!uv_is_closing(reinterpret_cast<uv_handle_t*>(&inspector->tcp))); + CHECK(!inspector->shutting_down); inspector->shutting_down = true; inspector->ws_state->close_cb = callback; if (inspector->connection_eof) { |