0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
Commit Graph

14 Commits

Author SHA1 Message Date
Ben Noordhuis
1b7372f2fb 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>
2017-07-27 17:11:08 +02:00
Jimmy Thomson
94dd42577c
test: fix cctest failure on Windows
Linux converts the ipv6 address "::" to "::1", while windows does not.
By explicitly using "::1" in the test we allow it to succeed on windows.

PR-URL: https://github.com/nodejs/node/pull/14111
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Kunal Pathak <kunal.pathak@microsoft.com>
Reviewed-By: João Reis <reis@janeasystems.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-07-10 12:33:21 -04:00
Eugene Ostroukhov
5fbbd25dc4 test: check uv_ip4_addr return value
Fixes Coverity errors.

PR-URL: https://github.com/nodejs/node/pull/13878
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-06-26 10:28:13 -07:00
Eugene Ostroukhov
3d0ef56264 inspector, test: Fix test bug detected by Coverity
Error value was not checked. Turns out, uv_ip6_addr was actually called
on malformed IP (square brackets should not have been included).

PR-URL: https://github.com/nodejs/node/pull/13799
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-06-21 11:20:22 -07:00
Eugene Ostroukhov
6e2c29bcab inspector: perform DNS lookup for host
PR-URL: https://github.com/nodejs/node/pull/13478
Fixes: https://github.com/nodejs/node/issues/13477
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2017-06-16 09:46:36 -07:00
Sam Roberts
26ab769940 inspector: refactor to rename and comment methods
Pure refactor, makes no functional changes but the renaming helped me
see more clearly what the relationship was between methods and
variables.

* Renamed methods to reduce number of slightly different names for the
  same thing ("thread" vs "io thread", etc.).
* Added comments where it was useful to me.

PR-URL: https://github.com/nodejs/node/pull/13321
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-06-01 15:54:34 -07:00
Daniel Bevenius
25ade76fb0
test: add override to ServerDone function
Currently the following compiler warning is displayed when building:

  ../test/cctest/test_inspector_socket_server.cc:142:8: warning:
  'ServerDone' overrides a member function but is not marked 'override'
        [-Winconsistent-missing-override]
    void ServerDone() {
         ^
  ../src/inspector_socket_server.h:30:16: note: overridden virtual
  function is here
    virtual void ServerDone() = 0;
                 ^

This commit marks ServerDone with override to get rid of the warning.

PR-URL: https://github.com/nodejs/node/pull/13166
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-05-25 17:54:49 +02:00
Eugene Ostroukhov
5c26378cb7 inspector: fix process._debugEnd() for inspector
This change ensures that the WebSocket server can be stopped
(and restarted if needed) buy calling process._debugEnd.

PR-URL: https://github.com/nodejs/node/pull/12777
Fixes: https://github.com/nodejs/node/issues/12559
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-05-22 11:18:31 -07:00
Eugene Ostroukhov
ba776b3a56 inspector: no crash when WS server can't start
This change also changes error message to make it consistent with the
one printed by the debugger.

Fixes: https://github.com/nodejs/node/issues/10858
PR-URL: https://github.com/nodejs/node/pull/10878
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-01-20 09:10:37 -08:00
Eugene Ostroukhov
295bd11468 test: have inspector test pick an open port
This ensures that cctest can be ran concurrently with other instances of
cctest or while the node is ran with --inspect.

Ref: https://github.com/nodejs/node/issues/10858
PR-URL: https://github.com/nodejs/node/pull/10861
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-01-19 11:00:09 -08:00
Daniel Bevenius
6d3c5b78c8 src: reduce test_inspector_socket_server output
Currently, when test/cctest/test_inspector_socket_server.cc is run there
is output written to stderr by src/inspector_socket_server.cc which is
interleaved with the gtest report:

Debugger listening on port 9229.
Warning: This is an experimental feature and could change at any time.
To start debugging, open the following URLs in Chrome:
  ...

The goal of this commit is to remove the above logged information
by introducing an out_ member in the InspectorSocketServer class
which defaults to stderr (keeping the current behavior).

Setting out_ to NULL is supported in which case nothing will be written
and is what the test has been configured with. When working on specific
test case the appropriate output stream can be specified for the
ServerHolder constructor to limit logging to that test case.

PR-URL: https://github.com/nodejs/node/pull/10537
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-01-06 20:13:12 +01:00
Eugene Ostroukhov
3196faedab test: fix Coverity warning in inspector test
PR-URL: https://github.com/nodejs/node/pull/10510
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-01-03 10:09:00 -08:00
Eugene Ostroukhov
3c29b2f851 inspector: fix Coverity defects
One defect remains - Coverity believes that a session object is never
freed while in reality its lifespan is tied to a libuv socket.

PR-URL: https://github.com/nodejs/node/pull/10240
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
2016-12-14 09:54:07 -08:00
Eugene Ostroukhov
42da740ed8 inspector: split HTTP/WS server from the inspector
Both our team experiments and some embedder request indicate a potential
in implementing alternative transport for inspector - e.g. IPC pipes or
custom embedder APIs. This change moves all HTTP specific code into a
separate class and is a first attempt at defining a boundary between the
inspector agent and transport. This API will be refined as new
transports are implemented.
Note that even without considering alternative transports, this change
enables better testing of the HTTP server (Valgrind made it possible to
identify and fix some existing memory leaks).

PR-URL: https://github.com/nodejs/node/pull/9630
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2016-12-06 14:47:49 -08:00