]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: beast: set a default port for endpoints 27660/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Thu, 28 Mar 2019 12:41:23 +0000 (13:41 +0100)
committerPrashant D <pdhange@redhat.com>
Wed, 17 Apr 2019 22:42:52 +0000 (18:42 -0400)
if no port is specified we don't set one(or set to 0), and don't exactly error
out, so rgw keeps running without being bound to a port. Set the port to default
in these cases

Fixes: http://tracker.ceph.com/issues/39000
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit 9e5d4bd1a5d74490268e4dc16e885a64a1c2644c)

src/rgw/rgw_asio_frontend.cc

index 9007fc138c49737362651f7e155e9bae830f00ea..e4be074ec74f8342ccedda59b3c735738553991f 100644 (file)
@@ -330,6 +330,8 @@ tcp::endpoint parse_endpoint(boost::asio::string_view input,
         auto port_str = input.substr(addr_end + 2);
         endpoint.port(parse_port(port_str.data(), ec));
       }
+    } else {
+      endpoint.port(default_port);
     }
     auto addr = input.substr(addr_begin, addr_end - addr_begin);
     endpoint.address(boost::asio::ip::make_address_v6(addr, ec));
@@ -341,6 +343,8 @@ tcp::endpoint parse_endpoint(boost::asio::string_view input,
       if (ec) {
         return endpoint;
       }
+    } else {
+      endpoint.port(default_port);
     }
     auto addr = input.substr(0, colon);
     endpoint.address(boost::asio::ip::make_address_v4(addr, ec));