# # # patch "Makefile.am" # from [61db7510b3fdd2cdab2ff2a0a0f3bddefbca0faa] # to [12eaf4946eb0c7da7bc3de72faf9a8b3c436e05b] # # patch "README.nuskool" # from [04f87d1a7666644cd6847bb50f0a2c3da584585d] # to [c44d99d78566da43f00fd36f23d262a7918f6289] # # patch "netsync.cc" # from [52a6093166e42c5ec4d051ef02711d015ef7ca01] # to [bc29436d8763e12d3fe5360d4bc19a6c4844ea44] # ============================================================ --- Makefile.am 61db7510b3fdd2cdab2ff2a0a0f3bddefbca0faa +++ Makefile.am 12eaf4946eb0c7da7bc3de72faf9a8b3c436e05b @@ -4,8 +4,8 @@ CMD_SOURCES = \ CMD_SOURCES = \ cmd.hh cmd_netsync.cc cmd_list.cc cmd_packet.cc cmd_key_cert.cc \ cmd_merging.cc cmd_db.cc cmd_diff_log.cc cmd_ws_commit.cc \ - cmd_othervcs.cc cmd_automate.cc cmd_files.cc cmd_conflicts.cc - cmd_othervcs.cc cmd_automate.cc cmd_files.cc cmd_scgi.cc + cmd_othervcs.cc cmd_automate.cc cmd_files.cc cmd_conflicts.cc \ + cmd_scgi.cc SANITY_CORE_SOURCES = \ sanity.cc sanity.hh quick_alloc.hh vector.hh base.hh \ @@ -20,8 +20,8 @@ LUAEXT_SOURCES = \ luaext_mkstemp.cc luaext_parse_basic_io.cc \ luaext_guess_binary.cc luaext_platform.cc luaext_globish.cc \ lua.cc lua.hh mkstemp.cc mkstemp.hh file_io.cc file_io.hh \ - globish.cc globish.hh basic_io.cc basic_io.hh json_io.cc \ - json_io.hh json_msgs.cc json_msgs.hh \ + globish.cc globish.hh basic_io.cc basic_io.hh \ + json_io.cc json_io.hh json_msgs.cc json_msgs.hh \ char_classifiers.hh MOST_SOURCES = \ ============================================================ --- README.nuskool 04f87d1a7666644cd6847bb50f0a2c3da584585d +++ README.nuskool c44d99d78566da43f00fd36f23d262a7918f6289 @@ -18,9 +18,9 @@ 3. start lighttpd $ /etc/init.d/lighttpd start -4. start a gserve server for lighttpd to proxy to +4. start an scgi server for lighttpd to proxy to - $ mtn gserve --db server.db + $ mtn scgi --db server.db 5. run the gsync client ============================================================ --- netsync.cc 52a6093166e42c5ec4d051ef02711d015ef7ca01 +++ netsync.cc bc29436d8763e12d3fe5360d4bc19a6c4844ea44 @@ -2650,6 +2650,39 @@ bool session::process(transaction_guard } } +void +add_address_names(Netxx::Address & addr, + std::list const & addresses, + Netxx::port_type default_port) +{ + if (addresses.empty()) + addr.add_all_addresses(default_port); + else + { + for (std::list::const_iterator + it = addresses.begin(); it != addresses.end(); ++it) + { + const utf8 & address = *it; + if (!address().empty()) + { + size_t l_colon = address().find(':'); + size_t r_colon = address().rfind(':'); + + if (l_colon == r_colon && l_colon == 0) + { + // can't be an IPv6 address as there is only one colon + // must be a : followed by a port + string port_str = address().substr(1); + addr.add_all_addresses(std::atoi(port_str.c_str())); + } + else + addr.add_address(address().c_str(), default_port); + } + } + } +} + + static shared_ptr make_server(std::list const & addresses, Netxx::port_type default_port, @@ -2660,32 +2693,7 @@ make_server(std::list const & addr try { addr = Netxx::Address(use_ipv6); - - if (addresses.empty()) - addr.add_all_addresses(default_port); - else - { - for (std::list::const_iterator it = addresses.begin(); - it != addresses.end(); ++it) - { - const utf8 & address = *it; - if (!address().empty()) - { - size_t l_colon = address().find(':'); - size_t r_colon = address().rfind(':'); - - if (l_colon == r_colon && l_colon == 0) - { - // can't be an IPv6 address as there is only one colon - // must be a : followed by a port - string port_str = address().substr(1); - addr.add_all_addresses(std::atoi(port_str.c_str())); - } - else - addr.add_address(address().c_str(), default_port); - } - } - } + add_address_names(addr, addresses, default_port); shared_ptr ret(new Netxx::StreamServer(addr, timeout)); char const * name; @@ -3186,37 +3194,6 @@ session_from_server_sync_item(options & } } -void -add_address_names(Netxx::Address & addr, - std::list const & addresses, - Netxx::port_type default_port) -{ - if (addresses.empty()) - addr.add_all_addresses(default_port); - else - { - for (std::list::const_iterator it = addresses.begin(); it != addresses.end(); ++it) - { - const utf8 & address = *it; - if (!address().empty()) - { - size_t l_colon = address().find(':'); - size_t r_colon = address().rfind(':'); - - if (l_colon == r_colon && l_colon == 0) - { - // can't be an IPv6 address as there is only one colon - // must be a : followed by a port - string port_str = address().substr(1); - addr.add_all_addresses(std::atoi(port_str.c_str())); - } - else - addr.add_address(address().c_str(), default_port); - } - } - } -} - static void serve_connections(options & opts, lua_hooks & lua, @@ -3238,8 +3215,6 @@ serve_connections(options & opts, react, role, addresses, guard, use_ipv6)); react.add(listen, *guard); - Netxx::Address addr(use_ipv6); - add_address_names(addr, addresses, default_port); while (true)