# # # patch "cmd_netsync.cc" # from [a2432bc640b31527fcc379e5841fb429051b8cf5] # to [c71251830cfe3887c8cc5185b2b06491407d84b8] # # patch "netsync.cc" # from [adccba9bcd9996ef79da1df783855188132b97fe] # to [3640dd6b17a9a3e32f2766391d23a19a3e82aa3a] # # patch "network/connection_info.cc" # from [58c77408b07648b8551b85115902223ae7682ffa] # to [42e4520e9efbacda6b7dd97ccb3a513ce48c3938] # # patch "network/connection_info.hh" # from [25de3ca6cdb36b10c3f08cd44c3814edf8836dbe] # to [2578ebe8394cf7611bc4db06fce0f6917a390f67] # # patch "network/listener.cc" # from [c6cc4274be968e6adb46a5bcb96fe9ef9d800e98] # to [ce79e9f57c7f37e4f655305fb5f54455b0cf496d] # # patch "network/listener.hh" # from [c18763f684c82232aaf8bed82a46cf771586657b] # to [c7c63c80badf9dcfbc0855c73d1fa51d42184afb] # # patch "network/make_server.cc" # from [7344c6d4b47bb6d975442542b9447ecd1582d7e1] # to [582122f00139ded0a6a812fc97b1e1db660d0fd5] # # patch "network/make_server.hh" # from [25b6e2faa53607d06e4b9b2e14ec1ab29c68b67e] # to [aa03e82f172412ac9f2e4b077e3772589b3286c0] # # patch "network/session.cc" # from [1ad93d8c4273899545b5404882126281cfcd4096] # to [40cad838dd7bd8417b4bb7464f2f35a578eb1dc5] # # patch "options_list.hh" # from [291e3ef23453a66beb00a2c7d3ebd983fb1ce02c] # to [7b5dc56672092918b420812ca425b2fc0766c086] # ============================================================ --- cmd_netsync.cc a2432bc640b31527fcc379e5841fb429051b8cf5 +++ cmd_netsync.cc c71251830cfe3887c8cc5185b2b06491407d84b8 @@ -93,10 +93,10 @@ extract_client_connection_info(options & } } - opts.use_transport_auth = - lua.hook_use_transport_auth(info->client.get_uri()); + opts.no_transport_auth = + !lua.hook_use_transport_auth(info->client.get_uri()); - if (opts.use_transport_auth) + if (!opts.no_transport_auth) { cache_netsync_key(opts, project, keys, lua, info, key_requiredness); } @@ -489,10 +489,10 @@ CMD_NO_WORKSPACE(clone, "clone", "", CMD I(!app.opts.branch().empty()); - app.opts.use_transport_auth = - app.lua.hook_use_transport_auth(info->client.get_uri()); + app.opts.no_transport_auth = + !app.lua.hook_use_transport_auth(info->client.get_uri()); - if (app.opts.use_transport_auth) + if (!app.opts.no_transport_auth) { cache_netsync_key(app.opts, project, keys, app.lua, info, key_optional); } @@ -652,7 +652,7 @@ CMD_NO_WORKSPACE(serve, "serve", "", CMD shared_conn_info info; netsync_connection_info::setup_for_serve(app.opts, project.db, app.lua, info); - if (app.opts.use_transport_auth) + if (!app.opts.no_transport_auth) { cache_netsync_key(app.opts, project, keys, app.lua, info, key_required); } ============================================================ --- netsync.cc adccba9bcd9996ef79da1df783855188132b97fe +++ netsync.cc 3640dd6b17a9a3e32f2766391d23a19a3e82aa3a @@ -269,7 +269,7 @@ serve_connections(app_state & app, project_t & project, key_store & keys, protocol_role role, - std::list const & addresses) + std::vector const & addresses) { #ifdef USE_IPV6 bool use_ipv6=true; ============================================================ --- network/connection_info.cc 58c77408b07648b8551b85115902223ae7682ffa +++ network/connection_info.cc 42e4520e9efbacda6b7dd97ccb3a513ce48c3938 @@ -478,7 +478,7 @@ netsync_connection_info::setup_for_serve info->server.addrs = opts.bind_uris; info->client.conn_type = netsync_connection; - if (opts.use_transport_auth) + if (!opts.no_transport_auth) { E(lua.hook_persist_phrase_ok(), origin::user, F("need permission to store persistent passphrase " ============================================================ --- network/connection_info.hh 25de3ca6cdb36b10c3f08cd44c3814edf8836dbe +++ network/connection_info.hh 2578ebe8394cf7611bc4db06fce0f6917a390f67 @@ -30,7 +30,7 @@ struct netsync_connection_info class Server { public: - std::list addrs; + std::vector addrs; } server; class Client { ============================================================ --- network/listener.cc c6cc4274be968e6adb46a5bcb96fe9ef9d800e98 +++ network/listener.cc ce79e9f57c7f37e4f655305fb5f54455b0cf496d @@ -21,7 +21,7 @@ #include "network/reactor.hh" #include "network/session.hh" -using std::list; +using std::vector; using std::string; using boost::lexical_cast; @@ -32,7 +32,7 @@ listener::listener(app_state & app, key_store & keys, reactor & react, protocol_role role, - list const & addresses, + vector const & addresses, shared_ptr &guard, bool use_ipv6) : listener_base(shared_ptr()), ============================================================ --- network/listener.hh c18763f684c82232aaf8bed82a46cf771586657b +++ network/listener.hh c7c63c80badf9dcfbc0855c73d1fa51d42184afb @@ -11,7 +11,7 @@ #ifndef __LISTENER_HH__ #define __LISTENER_HH__ -#include +#include "vector.hh" #include "netcmd.hh" #include "network/listener_base.hh" @@ -45,7 +45,7 @@ public: key_store & keys, reactor & react, protocol_role role, - std::list const & addresses, + std::vector const & addresses, boost::shared_ptr &guard, bool use_ipv6); ============================================================ --- network/make_server.cc 7344c6d4b47bb6d975442542b9447ecd1582d7e1 +++ network/make_server.cc 582122f00139ded0a6a812fc97b1e1db660d0fd5 @@ -14,14 +14,14 @@ #include "lexical_cast.hh" #include "vocab.hh" -using std::list; +using std::vector; using std::string; using boost::lexical_cast; using boost::shared_ptr; shared_ptr -make_server(list const & addresses, +make_server(vector const & addresses, Netxx::port_type default_port, Netxx::Timeout timeout, bool use_ipv6, @@ -35,7 +35,7 @@ make_server(list const & addresses addr.add_all_addresses(default_port); else { - for (std::list::const_iterator it = addresses.begin(); + for (std::vector::const_iterator it = addresses.begin(); it != addresses.end(); ++it) { const utf8 & address = *it; ============================================================ --- network/make_server.hh 25b6e2faa53607d06e4b9b2e14ec1ab29c68b67e +++ network/make_server.hh aa03e82f172412ac9f2e4b077e3772589b3286c0 @@ -11,7 +11,7 @@ #ifndef __MAKE_SERVER_HH__ #define __MAKE_SERVER_HH__ -#include +#include "vector.hh" #include @@ -20,7 +20,7 @@ boost::shared_ptr class utf8; boost::shared_ptr -make_server(std::list const & addresses, +make_server(std::vector const & addresses, Netxx::port_type default_port, Netxx::Timeout timeout, bool use_ipv6, ============================================================ --- network/session.cc 1ad93d8c4273899545b5404882126281cfcd4096 +++ network/session.cc 40cad838dd7bd8417b4bb7464f2f35a578eb1dc5 @@ -41,7 +41,7 @@ session::session(app_state & app, projec version(app.opts.max_netsync_version), max_version(app.opts.max_netsync_version), min_version(app.opts.min_netsync_version), - use_transport_auth(app.opts.use_transport_auth), + use_transport_auth(!app.opts.no_transport_auth), signing_key(keys.signing_key), cmd_in(0), armed(false), ============================================================ --- options_list.hh 291e3ef23453a66beb00a2c7d3ebd983fb1ce02c +++ options_list.hh 7b5dc56672092918b420812ca425b2fc0766c086 @@ -189,34 +189,14 @@ OPTSET(bind_opts) "revision is a head of an affected branch")) OPTSET(bind_opts) -OPTVAR(bind_opts, std::list, bind_uris, ) -OPTVAR(bind_opts, bool, bind_stdio, false) -OPTVAR(bind_opts, bool, use_transport_auth, true) - -OPTION(bind_opts, bind, true, "bind", - gettext_noop("address:port to listen on (default :4691)")) -#ifdef option_bodies -{ - bind_uris.push_back(utf8(arg, origin::user)); - bind_stdio = false; -} -#endif +GROUPED_SIMPLE_OPTION(bind_opts, bind_uris, "bind", std::vector, + gettext_noop("address:port to listen on (default :4691)")) HIDE(no_transport_auth) -OPTION(bind_opts, no_transport_auth, false, "no-transport-auth", - gettext_noop("disable transport authentication")) -#ifdef option_bodies -{ - use_transport_auth = false; -} -#endif +GROUPED_SIMPLE_OPTION(bind_opts, no_transport_auth, "no-transport-auth", bool, + gettext_noop("disable transport authentication")) HIDE(bind_stdio) -OPTION(bind_opts, bind_stdio, false, "stdio", - gettext_noop("serve netsync on stdio")) -#ifdef option_bodies -{ - bind_stdio = true; -} -#endif +GROUPED_SIMPLE_OPTION(bind_opts, bind_stdio, "stdio", bool, + gettext_noop("serve netsync on stdio")) OPT(max_netsync_version, "max-netsync-version", u8, constants::netcmd_current_protocol_version, @@ -446,16 +426,8 @@ GLOBAL_SIMPLE_OPTION(key, "key,k/use-def gettext_noop("sets the key for signatures, using either the key " "name or the key hash")) -// Remember COMMA doesn't work with GOPT, use long form. -//GOPT(key_dir, "keydir", system_path, get_default_keydir() COMMA origin::user, -// gettext_noop("set location of key store")) -OPTVAR(globals, system_path, key_dir, get_default_keydir() COMMA origin::user) -OPTION(globals, key_dir, true, "keydir", gettext_noop("set location of key store")) -#ifdef option_bodies -{ - key_dir = system_path(arg, origin::user); -} -#endif +GLOBAL_SIMPLE_OPTION(key_dir, "keydir", system_path, + gettext_noop("set location of key store")) SIMPLE_OPTION(keys_to_push, "key-to-push", std::vector, gettext_noop("push the specified key even if it hasn't signed anything"))