monotone

monotone Mtn Change Log

Age Message
11 years 4 months Improve netsync serve_single_connection.

* netsync.cc (session::read_some): Improve failure error messages.
(serve_single_connection): Improve messages. Exit on unknown file
descriptor, read/write errors.
Commit c728ae18598dfdf65af1a41127ef6d2da6aa1448, by stephen_leake-2@stephe-leake.org
11 years 5 months In netsync, terminate on protocol done, not on server disconnect, since

can't detect that for StdioStream.

* netsync.cc (session::process): Add documentation comment.
(call_server): Terminate on session complete, in case we can't detect
the server dropping the connection.
(reap_dead_sessions): Fix comment; it does _not_ check for clients
that have exchanged all items.
(serve_single_connection): Register both file descriptors from
StdioStream, fix termination to match.

* netxx_pipe.cc :
(StdioStream::get_readfd): New.
(StdioStream::get_writefd): New.
(SpawnedStream::close): Wait for child to exit before closing sockets.
(UNIT_TEST): Can't do 'cat' test anymore; it does not exit on its own.
(UNIT_TEST): Improve stdio_spawn test.
Commit fb4b8ba4506d9ec9d57ed9c2f55bf7c090e09b35, by stephen_leake-2@stephe-leake.org
11 years 5 months SpawnedStream: test for server closing socket.

* netxx_pipe.cc (SpawnedStream::SpawnedStream): Duplicate handles before passing to child.
(StdioStream::close): Don't close stream twice if called twice.
(UNIT_TEST stdio_stream): Test for closed socket.
(unit_test_spawn): Test for closed socket.

* netxx_pipe_stdio_main.cc (main): Don't write 'quit' to closed socket.
Commit 60668ca49891a5f12f79b0aceb885cb20459d750, by stephen_leake-2@stephe-leake.org
11 years 5 months StdioStream: close socket so client knows we disconnected.

* netsync.cc (build_stream_to_server): Respect Lua hook
'use_transport_auth' even when get_netsync_connect_command returns nil.

* netxx_pipe.cc (StdioStream::close): Close socket so the client knows
the server disconnected.
(unit_test_spawn): Test closing socket.

* netxx_pipe_stdio_main.cc (main): Exit on 'quit' message, to allow
testing for closed socket.
Commit 577bc66d581c748df412a57b9ce4e37b51a0e8ba, by stephen_leake-2@stephe-leake.org
11 years 5 months Fixes for netxx_pipe.cc for Unix

* netxx_pipe.cc (StdioStream::get_socketfd): Return readfd for unit test.
(StdioStream::StdioStream): Init readfd, writefd properly for Unix.

* netxx_pipe_stdio_main.cc (main): Remove bogus references to bytes_read.
Commit 40bbc03627a68c9e4afd5fddd9fc9401e6e26b2f, by stephen_leake-2@stephe-leake.org
11 years 5 months More progress on file: on Win32; netxx_pipe unit tests pass. But netsync_over_pipes lua test still hangs.

* netxx/probe.h (Netxx): minor cleanup

* netxx_pipe.cc (StdioStream::StdioStream): Don't need to set binary for
sockets on Win32.
(StdioStream::read): Use recv, send on Win32, copy loop logic from
netxx/socket.cxx.
(StdioStream::write): Ditto.
(err_msg): Move to win32/platform.cc
(StdioStream::set_socketfd): New for unit test.
(UNIT_TEST): Add pipe:stdio_stream, improve logic.

* netxx_pipe_stdio_main.cc (main): Delete read file support; doesn't work
with current version of Stdio_Stream. Add more information on exit;
exit on timeout, to match unit test use.

* platform.hh: Move win32_last_err_msg here.

* win32/process.cc (win32_last_err_msg): Move here from netxx_pipe.cc.
Commit 25609512782fe474133707a82d73349aa56f1f5c, by stephen_leake-2@stephe-leake.org
11 years 5 months merge of '4493cee3f8e1e1c21dd9a0bacefeb4326fb2b0d3'

and 'dcdf41beed701392dc3c600064b893bddf3793e6'
Commit 46d583283fe7416e0f7be9f8955713d5f27a6b98, by stephen_leake-2@stephe-leake.org
11 years 5 months In netxx_pipe StdioStream, always construct from stdin, stdout; use GetStdHandle on Win32.
Commit dcdf41beed701392dc3c600064b893bddf3793e6, by stephen_leake-2@stephe-leake.org
11 years 5 months merge of '7b10add17d23caedd53e54566b4c45b78610edc8'

and 'a9e0b4c057a8fd689d106041a727d4540bacbdcf'
Commit ed8e9a56ac877f2ab3c69913ff37c55f3c7e8938, by stephen_leake-2@stephe-leake.org
11 years 5 months Add unit test of StdioStream, StdioProbe.

* netxx_pipe.cc: Run unit test spawning 'cat' and 'netxx_pipe_stdio_main'.

* netxx_pipe_stdio_main.cc (main): Provide for file input. Handle exceptions.
Commit a9e0b4c057a8fd689d106041a727d4540bacbdcf, by stephen_leake-2@stephe-leake.org
11 years 5 months Use StdioStream in netxx_pipe unit test

* Makefile.am : add netxx_pipe_stdio_main

* netsync.cc (arm_sessions_and_calculate_probe): Use StdioProbe, since
Probe is not dispatching.
(serve_connections): Use StdioProbe, since
arm_sessions_and_calculate_probe requires it.
Commit 9358da1511a513699b588e3374f0579c36a4c244, by stephen_leake-2@stephe-leake.org
11 years 5 months First attempt at using sockets in netxx_pipe.cc. See last commit message; only one file was actually committed then; the comments apply to this commit.

* .mtn-ignore: ignore more stuff
Commit e765f89cc726c935f0e9358ff381c9a04e978544, by stephen_leake-2@stephe-leake.org
11 years 5 months Start fixing 'file:' and 'ssh:' netsync on Win32; they hang in some

situations. In netxx_pipe, split PipeStream into StdioStream,
SpawnedStream, use sockets instead of pipes. Compiles on Win32, fails
tests. Unix still under construction.

* Makefile.am (UNIX_PLATFORM_SOURCES):
(WIN32_PLATFORM_SOURCES): Add socketpair.c

* netsync.cc (build_stream_to_server): use SpawnedStream
(call_server): Use Probe
(drop_session_associated_with_fd): clean up; every session is in
session map exactly once.
(arm_sessions_and_calculate_probe): use Probe.
(serve_connections): Use Probe.
(serve_connections): Better name for 'other server'.
(serve_single_connection): Move stream, session creation here, use
StdioProbe. Only need to register the session under one socketfd,
even though there is another one.
(run_netsync_protocol): Move stream, session creation into
serve_single_connection.

* netxx/probe.h: Clean up whitespace. Change PipeCompatibleProbe to StdioProbe.

* netxx_pipe.hh:
* netxx_pipe.cc: Split PipeStream into StdioStream, SpawnedStream. Use
sockets instead of pipes.

* unix/socketpair.c: new file
* win32/socketpair.c: new file

* .mtn-ignore: Ignore more stuff created by building in the source tree.
Commit ce94cd401df7d3b1a444028954e9602cfa851e4d, by stephen_leake-2@stephe-leake.org
11 years 5 months merge of '1d3f11e2b9f19a4361aebad3116b9832cf4e5e36'

and '502579595c49bcc4844b2594049a19ed757e6b5f'
Commit a0813120218871b9b1944d7bb216b9c37970044b, by Richard Levitte

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status