# # # patch "ChangeLog" # from [d9c044ee4a4cf19de495e18c6a1ebf2c1cdebd76] # to [bf9b25304a445c37f73313148c7b16918a67910b] # # patch "netsync.cc" # from [0512bae49df37c80f4844fbe42435879ec30309b] # to [2fd9d1b3cbfb5500b18c8cae82f88a96cb9c50b8] # ============================================================ --- ChangeLog d9c044ee4a4cf19de495e18c6a1ebf2c1cdebd76 +++ ChangeLog bf9b25304a445c37f73313148c7b16918a67910b @@ -1,15 +1,3 @@ -2006-05-13 Timothy Brownawell - - * netsync.cc: (process_hello_cmd) Build our merkle tries after - replying to the server. - (call_server, serve_connections) Use instant timeout for our streams. - Looking at the netxx code, it appears that reads will select() using - the stream's timeout. Regardless of whether the stream has been set - non-blocking. - (call_server) Move maybe_step and maybe_say_goodbye to before we arm - the session. - (write_netcmd_and_try_flush) Uncomment the {read,write}_some calls. - 2006-05-12 Timothy Brownawell * lua.hh: Remove unused, unimplemented template lua_hooks::call_hook. ============================================================ --- netsync.cc 0512bae49df37c80f4844fbe42435879ec30309b +++ netsync.cc 2fd9d1b3cbfb5500b18c8cae82f88a96cb9c50b8 @@ -910,8 +910,8 @@ L(FL("dropping outgoing netcmd (because we're in error unwind mode)\n")); // FIXME: this helps keep the protocol pipeline full but it seems to // interfere with initial and final sequences. careful with it. - write_some(); - read_some(); + // write_some(); + // read_some(); } // This method triggers a special "error unwind" mode to netsync. In this @@ -1254,6 +1254,21 @@ decode_hexenc(their_key_hash, their_key_hash_decoded); this->remote_peer_key_hash = their_key_hash_decoded; } + + // clients always include in the synchronization set, every branch that the + // user requested + vector branchnames; + set ok_branches; + get_branches(app, branchnames); + for (vector::const_iterator i = branchnames.begin(); + i != branchnames.end(); i++) + { + if (our_matcher(*i)) + ok_branches.insert(utf8(*i)); + } + rebuild_merkle_trees(app, ok_branches); + + setup_client_tickers(); if (app.signing_key() != "") { @@ -1283,21 +1298,6 @@ queue_anonymous_cmd(this->role, our_include_pattern, our_exclude_pattern, mk_nonce(), their_key_encoded); } - - // clients always include in the synchronization set, every branch that the - // user requested - vector branchnames; - set ok_branches; - get_branches(app, branchnames); - for (vector::const_iterator i = branchnames.begin(); - i != branchnames.end(); i++) - { - if (our_matcher(*i)) - ok_branches.insert(utf8(*i)); - } - rebuild_merkle_trees(app, ok_branches); - - setup_client_tickers(); return true; } @@ -2250,13 +2250,10 @@ socket_options.set_non_blocking(); session sess(role, client_voice, include_pattern, exclude_pattern, - app, address(), server.get_socketfd(), instant); + app, address(), server.get_socketfd(), timeout); while (true) - { - sess.maybe_step(); - sess.maybe_say_goodbye(guard); - + { bool armed = false; try { @@ -2268,6 +2265,9 @@ % sess.peer_id % bd.what); } + sess.maybe_step(); + sess.maybe_say_goodbye(guard); + probe.clear(); probe.add(sess.str, sess.which_events()); Netxx::Probe::result_type res = probe.ready(armed ? instant : timeout); @@ -2593,7 +2593,7 @@ // it further down. try_again=use_ipv6; - Netxx::StreamServer server(addr, instant); + Netxx::StreamServer server(addr, timeout); // If we came this far, whatever we used (IPv6 or IPv4) was // accepted, so we don't need to try again any more. @@ -2652,7 +2652,7 @@ // we either got a new connection else if (fd == server) - handle_new_connection(addr, server, instant, role, + handle_new_connection(addr, server, timeout, role, include_pattern, exclude_pattern, sessions, app);