# # patch "commands.cc" # from [ab99b00be8f0a3f8dc6537c813b45aa35f49c1a7] # to [842439051f78178fd5c775e2b02943ee1df8e7dc] # # patch "netxx/probe.h" # from [ab8ffcf0b226a90c7f79c56a7d41346c23b0d664] # to [7dbd28f284875bb3af6e59db3be0fb9378f8e7bb] # # patch "netxx_pipe.cc" # from [e39ef04aa1dac4493d79a9b4aab1c43762bd3fc4] # to [9e9f6f72d89786ce74c0024e727bf2621c09f06a] # # patch "netxx_pipe.hh" # from [da5c07b8728ee74c0d91457d0bdafe9fd54dbd02] # to [ea2ea18000ee00822b72c66c5dec449a947f43bc] # ======================================================================== --- commands.cc ab99b00be8f0a3f8dc6537c813b45aa35f49c1a7 +++ commands.cc 842439051f78178fd5c775e2b02943ee1df8e7dc @@ -3708,10 +3708,10 @@ if (args.size() > 1) throw usage(name); string module; if (args.size() == 1) module = idx(args, 0)(); + N(!app.branch_name().empty(), F("no destination branch specified\n")); cvs_sync::takeover(app, module); } - CMD(cvs_admin, "network", "COMMAND ARG", "e.g. manifest REVISION", OPT_BRANCH_NAME) { ======================================================================== --- netxx/probe.h ab8ffcf0b226a90c7f79c56a7d41346c23b0d664 +++ netxx/probe.h 7dbd28f284875bb3af6e59db3be0fb9378f8e7bb @@ -48,6 +48,8 @@ namespace Netxx { +class PipeCompatibleProbe; + /** * The Netxx::Probe class is a wrapper around one of the Netxx probe * classes. The reason that we have a wrapper is because most operating @@ -55,6 +57,11 @@ * kqueue(2) or /dev/poll. **/ class Probe { + /* + * Probe has no public way to select read only and write only sockets + * needed for probing pipes, so grant PipeCompatibleProbe to use add_socket + */ + friend class PipeCompatibleProbe; public: /* * Bitmask for telling Probe exactly what you want and for testing the ======================================================================== --- netxx_pipe.cc e39ef04aa1dac4493d79a9b4aab1c43762bd3fc4 +++ netxx_pipe.cc 9e9f6f72d89786ce74c0024e727bf2621c09f06a @@ -9,8 +9,8 @@ Netxx::PipeStream::PipeStream(int _readfd, int _writefd) : readfd(_readfd), writefd(_writefd), child() -{ pi_.add_socket(readfd); - pi_.add_socket(writefd); +{ //pi_.add_socket(readfd); + //pi_.add_socket(writefd); } #ifndef __WIN32__ @@ -57,8 +57,8 @@ #include #include #include -#include #endif +#include Netxx::PipeStream::PipeStream (const std::string &cmd, const std::vector &args) : readfd(), writefd(), child() @@ -129,8 +129,7 @@ writefd=fd2[1]; fcntl(readfd,F_SETFL,fcntl(readfd,F_GETFL)|O_NONBLOCK); #endif - pi_.add_socket(readfd); -#warning FIXME! +// pi_.add_socket(readfd); // pi_.add_socket(writefd); } @@ -180,7 +179,7 @@ #endif const Netxx::ProbeInfo* Netxx::PipeStream::get_probe_info (void) const -{ return &pi_; +{ return 0; } #ifdef WIN32 @@ -255,6 +254,27 @@ { assert(!ip_pipe); Probe::add(ss,rt); } +#else // unix +void Netxx::PipeCompatibleProbe::add(PipeStream &ps, ready_type rt) +{ + if (rt==ready_none || rt&ready_read) add_socket(ps.get_readfd(),ready_read); + if (rt==ready_none || rt&ready_write) add_socket(ps.get_writefd(),ready_write); +} + +void Netxx::PipeCompatibleProbe::add(const StreamBase &sb, ready_type rt) +{ + try + { add(const_cast(dynamic_cast(sb)),rt); + } + catch (...) + { Probe::add(sb,rt); + } +} + +void Netxx::PipeCompatibleProbe::add(const StreamServer &ss, ready_type rt) +{ + Probe::add(ss,rt); +} #endif #ifdef BUILD_UNIT_TESTS ======================================================================== --- netxx_pipe.hh da5c07b8728ee74c0d91457d0bdafe9fd54dbd02 +++ netxx_pipe.hh ea2ea18000ee00822b72c66c5dec449a947f43bc @@ -34,14 +34,12 @@ */ namespace Netxx { -#ifdef WIN32 class PipeCompatibleProbe; class StreamServer; -#endif class PipeStream : public StreamBase { int readfd, writefd; - ProbeInfo pi_; +// ProbeInfo pi_; int child; #ifdef WIN32 char readbuf[1024]; @@ -87,6 +85,10 @@ #endif }; #else - typedef Probe PipeCompatibleProbe; + struct PipeCompatibleProbe : Probe + { void add(PipeStream &ps, ready_type rt=ready_none); + void add(const StreamBase &sb, ready_type rt=ready_none); + void add(const StreamServer &ss, ready_type rt=ready_none); + }; #endif }