21 Commits

Author SHA1 Message Date
Ben Boeckel
c7f3663b10 cmServerConnection: make return conversions explicit
GCC 9 warns that `std::move` is not necessary, but in fact it is
necessary to call the proper conversion constructor.  Make that call
explicit.
2019-02-22 11:02:13 -05:00
Regina Pfeifer
55671b41d2 clang-tidy: Use = default
Suppress some cases in `Source/cmGeneratorExpressionNode.cxx` and
`Source/cmUVHandlePtr.h` where a few older compilers require a
user-defined default constructor (with `{}`).
2019-01-25 06:44:32 -05:00
Brad King
cd0881be61 IWYU: Update CMake code for IWYU built with Clang 6
IWYU now correctly requires `<utility>` for `std::move`.  It also
requires a container header when used via a range-based for loop.
2019-01-15 10:00:50 -05:00
Kitware Robot
d7204e649e Revise C++ coding style using clang-format-6.0
Run the `clang-format.bash` script to update all our C and C++ code to a
new style defined by `.clang-format`.  Use `clang-format` version 6.0.

* If you reached this commit for a line in `git blame`, re-run the blame
  operation starting at the parent of this commit to see older history
  for the content.

* See the parent commit for instructions to rebase a change across this
  style transition commit.
2018-06-01 09:53:42 -04:00
Justin Berger
1e9b7d3ceb server: Switched to a auto model for handles 2017-11-29 16:36:31 -05:00
Justin Berger
124424e997 server: Protect several fields from potentially pointing to bad memory 2017-08-31 15:35:46 -04:00
Justin Berger
7ef2884361 server: Moved buffer formatting into bufferstrategy 2017-08-31 15:35:04 -04:00
Justin Berger
f8fd5a979c server: Made stdio connection accept different types of streams 2017-08-31 15:35:04 -04:00
Justin Berger
546a587469 server: Fixed mismatched new/delete; added proper shutdown procedure 2017-08-31 15:35:03 -04:00
Justin Berger
cf0ae55dcb server: Add support for connections that aren't event based 2017-07-10 18:12:05 -06:00
Justin Berger
d4f5d35ca4 server: Refactor to make the event loop owned by server object 2017-07-10 18:11:27 -06:00
Daniel Pfeifer
f3e216131b cmServer: include what you use 2017-05-06 00:03:47 +02:00
Daniel Pfeifer
2e620f0b38 Fix several include-what-you-use findings 2016-11-08 09:42:04 -05:00
Tobias Hunger
9112c43ebc server-mode: Fix named pipe mode
Do not treat a pointer itself as a `uv_stream_t`, but instead the
pointed-to `uv_pipe_t`.  It is unclear how this ever worked before in
local testing.

While at it, remove duplicate setup code and improve an error message.
2016-10-18 10:55:01 -04:00
Tobias Hunger
68277e16c4 server-mode: Improve shutdown behavior
Add a signal handler to trigger shutdown and be more paranoid about
libuv doing things asynchronously.  This should fix test cases not
shutting down properly.
2016-10-04 09:15:32 -04:00
Brad King
1b43f9d12d cmake-server: Stop the file monitor on client disconnect
When the client disconnects we need to remove all events from our loop.
Prior to the introduction of the file monitor we only needed to remove
the client pipes.  Now we need to remove the file monitor events too.

Without this the event loop may continue to block on file monitor
events.  If one does eventually come in then the event handler may try
to report it to the disconnected client and crash because our internal
structures for writing to the client have been freed.

This addresses a failure of the `Server` test on some machines.
2016-09-30 15:05:42 -04:00
Tobias Hunger
0d96e19329 server-mode: Add infrastructure to watch the filesystem
Enable the server to watch for filesystem changes. This patch includes
* The infrastructure for the file watching
* makes that infrastructure available to cmServerProtocols
* Resets the filesystemwatchers on "configure"
2016-09-29 21:47:05 +02:00
Brad King
86578eccf2 Simplify CMake per-source license notices
Per-source copyright/license notice headers that spell out copyright holder
names and years are hard to maintain and often out-of-date or plain wrong.
Precise contributor information is already maintained automatically by the
version control tool.  Ultimately it is the receiver of a file who is
responsible for determining its licensing status, and per-source notices are
merely a convenience.  Therefore it is simpler and more accurate for
each source to have a generic notice of the license name and references to
more detailed information on copyright holders and full license terms.

Our `Copyright.txt` file now contains a list of Contributors whose names
appeared source-level copyright notices.  It also references version control
history for more precise information.  Therefore we no longer need to spell
out the list of Contributors in each source file notice.

Replace CMake per-source copyright/license notice headers with a short
description of the license and links to `Copyright.txt` and online information
available from "https://cmake.org/licensing".  The online URL also handles
cases of modules being copied out of our source into other projects, so we
can drop our notices about replacing links with full license text.

Run the `Utilities/Scripts/filter-notices.bash` script to perform the majority
of the replacements mechanically.  Manually fix up shebang lines and trailing
newlines in a few files.  Manually update the notices in a few files that the
script does not handle.
2016-09-27 15:14:44 -04:00
Daniel Pfeifer
92207752df cmServer: add braces around conditional statements 2016-09-23 22:43:36 +02:00
Tobias Hunger
277ffa2881 server-mode: Move constants for server mode into its own file
This removes some duplication and makes it easier to reuse the
vocabulary.
2016-09-22 16:30:02 +02:00
Tobias Hunger
1d601c6cb9 server-mode: Introduce cmServerConnection
Use it to split pipe and stdin/out handling out of cmServer itself.

The server will shut down when it looses its connection to the client.
This has the nice property that a crashing client will cause the server
to terminate as the OS will close the connection on behave of the client.
2016-09-22 08:06:38 -04:00