]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: beast: set a default port for endpoints 27661/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:45:50 +0000 (18:45 -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 3c6ae446990eed00b52469ea6d3e1f457c44508e..7073d5c5f7c03371b80017843da26d716cf5b2cd 100644 (file)
@@ -283,6 +283,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));
@@ -294,6 +296,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));