]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: beast: set a default port for endpoints 27242/head
authorAbhishek Lekshmanan <abhishek@suse.com>
Thu, 28 Mar 2019 12:41:23 +0000 (13:41 +0100)
committerAbhishek Lekshmanan <abhishek@suse.com>
Fri, 29 Mar 2019 15:30:53 +0000 (16:30 +0100)
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>
src/rgw/rgw_asio_frontend.cc

index b0b66edef91a2e9cbc54b2e838240f42005fe7a5..89306c0caa9d564633d9af3dbbde4f61c95cb2ae 100644 (file)
@@ -329,6 +329,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));
@@ -340,6 +342,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));