# # # patch "gsync.cc" # from [fd59be076425f3b332ce8dda02533df2ad3d5be8] # to [80cd12eeb807b0113268b62772e96a0d1549ed8e] # # patch "http_client.cc" # from [810e141e9c3a48ad8845aee74a4826e38f5b2610] # to [8a6e5e93aee92d78c8e3b836105943cd4c462719] # ============================================================ --- gsync.cc fd59be076425f3b332ce8dda02533df2ad3d5be8 +++ gsync.cc 80cd12eeb807b0113268b62772e96a0d1549ed8e @@ -411,7 +411,7 @@ UNIT_TEST(gsync, gsync_common_core) ours.insert(rid6); ours.insert(rid8); - // prepaire an ancestry map + // prepare an ancestry map rev_ancestry_map parent_to_child_map, child_to_parent_map; parent_to_child_map.insert(make_pair(rid1, rid2)); parent_to_child_map.insert(make_pair(rid1, rid3)); ============================================================ --- http_client.cc 810e141e9c3a48ad8845aee74a4826e38f5b2610 +++ http_client.cc 8a6e5e93aee92d78c8e3b836105943cd4c462719 @@ -56,10 +56,11 @@ http_client::http_client(options & opts, u(u), include_pattern(include_pattern), exclude_pattern(exclude_pattern), - stream(build_stream_to_server(opts, lua, u, include_pattern, exclude_pattern, - (u.port.empty() ? constants::default_http_port - : lexical_cast(u.port)), - Netxx::Timeout(static_cast(constants::netsync_timeout_seconds)))), + stream(build_stream_to_server(opts, lua, u, + include_pattern, exclude_pattern, + u.parse_port(constants::default_http_port), + Netxx::Timeout(static_cast( + constants::netsync_timeout_seconds)))), nb(new Netbuf(*stream)), io(new iostream(&(*nb))), open(true) @@ -71,11 +72,13 @@ http_client::transact_json(json_value_t if (!open) { L(FL("reopening connection")); - stream = build_stream_to_server(opts, lua, u, include_pattern, exclude_pattern, - (u.port.empty() ? constants::default_http_port - : lexical_cast(u.port)), - Netxx::Timeout(static_cast(constants::netsync_timeout_seconds))); - nb = shared_ptr< Netbuf >(new Netbuf(*stream)); + stream(build_stream_to_server(opts, lua, u, + include_pattern, exclude_pattern, + u.parse_port(constants::default_http_port), + Netxx::Timeout(static_cast( + constants::netsync_timeout_seconds)))), + nb = shared_ptr< Netbuf >( + new Netbuf(*stream)); io = shared_ptr(new iostream(&(*nb))); open = true; } @@ -147,10 +150,12 @@ http_client::parse_http_header_line(size L(FL("http_client: header: [[%s %s]]") % k % v); std::getline(*io, rest); - if (k == "Content-Length:" || k == "Content-length:" || k == "content-length:") + if (k == "Content-Length:" || k == "Content-length:" || + k == "content-length:") content_length = lexical_cast(v); else if (k == "Connection:" || k == "connection:") - keepalive = (v == "Keep-Alive" || v == "Keep-alive" || v == "keep-alive"); + keepalive = (v == "Keep-Alive" || v == "Keep-alive" || + v == "keep-alive"); } @@ -240,7 +245,8 @@ http_channel::push_file_delta(file_id co file_id const & new_id, file_delta const & delta) const { - json_value_t request = encode_msg_put_file_delta_request(old_id, new_id, delta); + json_value_t request = encode_msg_put_file_delta_request( + old_id, new_id, delta); json_value_t response = client.transact_json(request); E(decode_msg_put_file_delta_response(response), F("received unexpected reply to 'put_file_delta_request' message"));