Compile RangeSse42.cpp with -msse4.2
[folly.git] / folly / Uri.h
index c8712160a97c479fefdfea4e5078432ac22a624e..fe88523d6afce30737a2849cd35ed5951f091fcb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#ifndef FOLLY_URI_H_
+#pragma once
 #define FOLLY_URI_H_
 
 #include <folly/String.h>
@@ -76,7 +76,10 @@ class Uri {
   std::string str() const { return toString<std::string>(); }
   fbstring fbstr() const { return toString<fbstring>(); }
 
-  void setPort(uint16_t port) {port_ = port;}
+  void setPort(uint16_t port) {
+    hasAuthority_ = true;
+    port_ = port;
+  }
 
   /**
    * Get query parameters as key-value pairs.
@@ -105,6 +108,7 @@ class Uri {
   fbstring username_;
   fbstring password_;
   fbstring host_;
+  bool hasAuthority_;
   uint16_t port_;
   fbstring path_;
   fbstring query_;
@@ -115,5 +119,3 @@ class Uri {
 }  // namespace folly
 
 #include <folly/Uri-inl.h>
-
-#endif /* FOLLY_URI_H_ */