You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2012/09/17 23:15:44 UTC

svn commit: r1386846 - in /incubator/mesos/trunk/third_party/libprocess/include: process/http.hpp stout/strings.hpp

Author: benh
Date: Mon Sep 17 21:15:44 2012
New Revision: 1386846

URL: http://svn.apache.org/viewvc?rev=1386846&view=rev
Log:
Cleaned up some documentation (https://reviews.apache.org/r/7007).

Modified:
    incubator/mesos/trunk/third_party/libprocess/include/process/http.hpp
    incubator/mesos/trunk/third_party/libprocess/include/stout/strings.hpp

Modified: incubator/mesos/trunk/third_party/libprocess/include/process/http.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/process/http.hpp?rev=1386846&r1=1386845&r2=1386846&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/process/http.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/process/http.hpp Mon Sep 17 21:15:44 2012
@@ -145,13 +145,14 @@ struct TemporaryRedirect : Response
 
 namespace query {
 
-// Returns a string map based on calling split twice. For example:
+// Parses an HTTP query string into a map. For example:
 //
-//   pairs("foo=1;bar=2;foo=3", ";&", "=")
+//   parse("foo=1;bar=2;baz;foo=3")
 //
 // Would return a map with the following:
-//   foo: 3
-//   bar: 2
+//   bar: "2"
+//   baz: ""
+//   foo: "3"
 //
 // We use the last value for a key for simplicity, since the RFC does not
 // specify how to handle duplicate keys:

Modified: incubator/mesos/trunk/third_party/libprocess/include/stout/strings.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/third_party/libprocess/include/stout/strings.hpp?rev=1386846&r1=1386845&r2=1386846&view=diff
==============================================================================
--- incubator/mesos/trunk/third_party/libprocess/include/stout/strings.hpp (original)
+++ incubator/mesos/trunk/third_party/libprocess/include/stout/strings.hpp Mon Sep 17 21:15:44 2012
@@ -113,14 +113,14 @@ inline std::vector<std::string> split(
 }
 
 
-// Returns a map of strings to strings based on calling split
-// twice. For example:
+// Returns a map of strings to strings based on calling tokenize
+// twice. All non-pairs are discarded. For example:
 //
-//   pairs("foo=1;bar=2;foo=3", ";&", "=")
+//   pairs("foo=1;bar=2;baz;foo=3;bam=1=2", ";&", "=")
 //
 // Would return a map with the following:
-//   foo: [1, 3]
-//   bar: [2]
+//   bar: ["2"]
+//   foo: ["1", "3"]
 inline std::map<std::string, std::vector<std::string> > pairs(
     const std::string& s,
     const std::string& delims1,