From: Will Hodges Date: Mon, 10 Mar 2014 17:15:35 +0000 (-0700) Subject: Add setPort() to folly::URI class. X-Git-Tag: v0.22.0~652 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=86fd9acf3fd36e7c54b62bf476dd905803bd7d8d;p=folly.git Add setPort() to folly::URI class. Summary: Add setPort() method to URI class for easy port replacement in URIs. Facebook: Perform port replacement in WriteProcessor.cpp in a way that supports URI schemes. Add setPort() method to URI class to replace the port number in the authority portion of the URI. Test Plan: Test in debugger for dfsrouter changes. Reviewed By: tudorb@fb.com FB internal diff: D1209120 --- diff --git a/folly/Uri.h b/folly/Uri.h index bbee0bd3..29711197 100644 --- a/folly/Uri.h +++ b/folly/Uri.h @@ -61,6 +61,8 @@ class Uri { std::string str() const { return toString(); } fbstring fbstr() const { return toString(); } + void setPort(uint16_t port) {port_ = port;} + private: fbstring scheme_; fbstring username_;