[Lldb-commits] [PATCH] D12025: Make UriParser to support [$HOSTNAME] notation.

Tamas Berghammer via lldb-commits lldb-commits at lists.llvm.org
Thu Aug 20 02:02:45 PDT 2015


tberghammer added inline comments.

================
Comment at: source/Utility/UriParser.cpp:13
@@ -12,4 +12,3 @@
 // C Includes
-#include <stdlib.h>
-#include <stdio.h>
+#include <string.h>
 
----------------
I think you wanted to include <string>, not <string.h>

================
Comment at: source/Utility/UriParser.cpp:52-61
@@ +51,12 @@
+    // Extract hostname
+    if (host_port[0] == '[')
+    {
+        // hostname is enclosed with square brackets.
+        pos = host_port.find(']');
+        if (pos == std::string::npos)
+            return false;
+
+        tmp_hostname = host_port.substr(1, pos - 1);
+        host_port.erase(0, pos + 1);
+    }
+    else
----------------
I would prefer no to remove the '[' and the ']' characters from the hostname. At the moment you don't use the hostname for the adb protocol so it isn't matter but if we consider IPv6 then having '[' and ']' around the address sounds like a good idea to me (later stages can use this information).


http://reviews.llvm.org/D12025





More information about the lldb-commits mailing list