{"action":"created","comment":{"url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/comments/90036536","pull_request_review_id":10562116,"id":90036536,"diff_hunk":"@@ -0,0 +1,305 @@\n+// Part of measurement-kit <https://measurement-kit.github.io/>.\n+// Measurement-kit is free software. See AUTHORS and LICENSE for more\n+// information on the copying conditions.\n+\n+#include <measurement_kit/ext.hpp>\n+#include <measurement_kit/ooni.hpp>\n+\n+#include \"../cmdline/cmdline.hpp\"\n+/*\n+ * TODO: made these interfaces available through measurement-kit public API\n+ */\n+#include \"../../libmeasurement_kit/libevent/connection.hpp\"\n+#include \"../../libmeasurement_kit/libevent/listen.hpp\"\n+\n+namespace mk {\n+namespace cmdline {\n+namespace agent {\n+\n+/*\n+ * FIXME With this usage, anyone can see the password using `ps auxww`\n+ */\n+#define USAGE \"usage: measurement_kit agent [-v] [-p port] passwd\\n\"\n+\n+class Context {\n+  public:\n+    bool authenticated = false;\n+    Var<net::Buffer> buff{new net::Buffer};\n+    Var<Logger> logger;\n+    std::string passwd = \"\";\n+    Var<Reactor> reactor;\n+    Var<net::Transport> txp;\n+};\n+\n+/**\n+ * Remove the next token from string.\n+ * @param s String to read token from, updated in output.\n+ * @return Next token or error.\n+ */\n+static ErrorOr<std::string> remove_next_token(std::string &s) {\n+    size_t pos = s.find_first_of(\" \");\n+    if (pos == std::string::npos) {\n+        return GenericError();","path":"src/measurement_kit/cmdline/agent.cpp","position":42,"original_position":42,"commit_id":"ab7c8b4a427d9102a047d78d7fe5e70889b02558","original_commit_id":"ab7c8b4a427d9102a047d78d7fe5e70889b02558","user":{"login":"bassosimone","id":337298,"avatar_url":"https://avatars.githubusercontent.com/u/337298?v=3","gravatar_id":"","url":"https://api.github.com/users/bassosimone","html_url":"https://github.com/bassosimone","followers_url":"https://api.github.com/users/bassosimone/followers","following_url":"https://api.github.com/users/bassosimone/following{/other_user}","gists_url":"https://api.github.com/users/bassosimone/gists{/gist_id}","starred_url":"https://api.github.com/users/bassosimone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bassosimone/subscriptions","organizations_url":"https://api.github.com/users/bassosimone/orgs","repos_url":"https://api.github.com/users/bassosimone/repos","events_url":"https://api.github.com/users/bassosimone/events{/privacy}","received_events_url":"https://api.github.com/users/bassosimone/received_events","type":"User","site_admin":false},"body":"TODO: here we should probably return a better error","created_at":"2016-11-29T15:47:39Z","updated_at":"2016-11-29T15:47:39Z","html_url":"https://github.com/measurement-kit/measurement-kit/pull/969#discussion_r90036536","pull_request_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/969","_links":{"self":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/comments/90036536"},"html":{"href":"https://github.com/measurement-kit/measurement-kit/pull/969#discussion_r90036536"},"pull_request":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/969"}}},"pull_request":{"url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/969","id":95687807,"html_url":"https://github.com/measurement-kit/measurement-kit/pull/969","diff_url":"https://github.com/measurement-kit/measurement-kit/pull/969.diff","patch_url":"https://github.com/measurement-kit/measurement-kit/pull/969.patch","issue_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/969","number":969,"state":"open","locked":false,"title":"MK control port","user":{"login":"bassosimone","id":337298,"avatar_url":"https://avatars.githubusercontent.com/u/337298?v=3","gravatar_id":"","url":"https://api.github.com/users/bassosimone","html_url":"https://github.com/bassosimone","followers_url":"https://api.github.com/users/bassosimone/followers","following_url":"https://api.github.com/users/bassosimone/following{/other_user}","gists_url":"https://api.github.com/users/bassosimone/gists{/gist_id}","starred_url":"https://api.github.com/users/bassosimone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bassosimone/subscriptions","organizations_url":"https://api.github.com/users/bassosimone/orgs","repos_url":"https://api.github.com/users/bassosimone/repos","events_url":"https://api.github.com/users/bassosimone/events{/privacy}","received_events_url":"https://api.github.com/users/bassosimone/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-11-29T13:03:02Z","updated_at":"2016-11-29T15:47:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2438b34862ee26bdca13e44ffe8b3a2b5f8c7da","assignee":{"login":"bassosimone","id":337298,"avatar_url":"https://avatars.githubusercontent.com/u/337298?v=3","gravatar_id":"","url":"https://api.github.com/users/bassosimone","html_url":"https://github.com/bassosimone","followers_url":"https://api.github.com/users/bassosimone/followers","following_url":"https://api.github.com/users/bassosimone/following{/other_user}","gists_url":"https://api.github.com/users/bassosimone/gists{/gist_id}","starred_url":"https://api.github.com/users/bassosimone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bassosimone/subscriptions","organizations_url":"https://api.github.com/users/bassosimone/orgs","repos_url":"https://api.github.com/users/bassosimone/repos","events_url":"https://api.github.com/users/bassosimone/events{/privacy}","received_events_url":"https://api.github.com/users/bassosimone/received_events","type":"User","site_admin":false},"assignees":[{"login":"bassosimone","id":337298,"avatar_url":"https://avatars.githubusercontent.com/u/337298?v=3","gravatar_id":"","url":"https://api.github.com/users/bassosimone","html_url":"https://github.com/bassosimone","followers_url":"https://api.github.com/users/bassosimone/followers","following_url":"https://api.github.com/users/bassosimone/following{/other_user}","gists_url":"https://api.github.com/users/bassosimone/gists{/gist_id}","starred_url":"https://api.github.com/users/bassosimone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bassosimone/subscriptions","organizations_url":"https://api.github.com/users/bassosimone/orgs","repos_url":"https://api.github.com/users/bassosimone/repos","events_url":"https://api.github.com/users/bassosimone/events{/privacy}","received_events_url":"https://api.github.com/users/bassosimone/received_events","type":"User","site_admin":false},{"login":"hellais","id":424620,"avatar_url":"https://avatars.githubusercontent.com/u/424620?v=3","gravatar_id":"","url":"https://api.github.com/users/hellais","html_url":"https://github.com/hellais","followers_url":"https://api.github.com/users/hellais/followers","following_url":"https://api.github.com/users/hellais/following{/other_user}","gists_url":"https://api.github.com/users/hellais/gists{/gist_id}","starred_url":"https://api.github.com/users/hellais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hellais/subscriptions","organizations_url":"https://api.github.com/users/hellais/orgs","repos_url":"https://api.github.com/users/hellais/repos","events_url":"https://api.github.com/users/hellais/events{/privacy}","received_events_url":"https://api.github.com/users/hellais/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/969/commits","review_comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/969/comments","review_comment_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/969/comments","statuses_url":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/ab7c8b4a427d9102a047d78d7fe5e70889b02558","head":{"label":"measurement-kit:feature/mk-ctrl-port","ref":"feature/mk-ctrl-port","sha":"ab7c8b4a427d9102a047d78d7fe5e70889b02558","user":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"repo":{"id":20287787,"name":"measurement-kit","full_name":"measurement-kit/measurement-kit","owner":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/measurement-kit/measurement-kit","description":"Portable C++11 network measurement library","fork":false,"url":"https://api.github.com/repos/measurement-kit/measurement-kit","forks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/forks","keys_url":"https://api.github.com/repos/measurement-kit/measurement-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/measurement-kit/measurement-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/measurement-kit/measurement-kit/teams","hooks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/hooks","issue_events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/events{/number}","events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/events","assignees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/assignees{/user}","branches_url":"https://api.github.com/repos/measurement-kit/measurement-kit/branches{/branch}","tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/tags","blobs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/measurement-kit/measurement-kit/languages","stargazers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/stargazers","contributors_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contributors","subscribers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscribers","subscription_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscription","commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contents/{+path}","compare_url":"https://api.github.com/repos/measurement-kit/measurement-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/measurement-kit/measurement-kit/merges","archive_url":"https://api.github.com/repos/measurement-kit/measurement-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/measurement-kit/measurement-kit/downloads","issues_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues{/number}","pulls_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/measurement-kit/measurement-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/measurement-kit/measurement-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/measurement-kit/measurement-kit/labels{/name}","releases_url":"https://api.github.com/repos/measurement-kit/measurement-kit/releases{/id}","deployments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/deployments","created_at":"2014-05-29T08:44:43Z","updated_at":"2016-11-25T00:32:17Z","pushed_at":"2016-11-29T15:46:02Z","git_url":"git://github.com/measurement-kit/measurement-kit.git","ssh_url":"git@github.com:measurement-kit/measurement-kit.git","clone_url":"https://github.com/measurement-kit/measurement-kit.git","svn_url":"https://github.com/measurement-kit/measurement-kit","homepage":"https://measurement-kit.github.io/","size":12744,"stargazers_count":22,"watchers_count":22,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":91,"forks":6,"open_issues":91,"watchers":22,"default_branch":"master"}},"base":{"label":"measurement-kit:master","ref":"master","sha":"345f9be72230f06be9b02f8cebc6545ad475c37e","user":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"repo":{"id":20287787,"name":"measurement-kit","full_name":"measurement-kit/measurement-kit","owner":{"login":"measurement-kit","id":11982841,"avatar_url":"https://avatars.githubusercontent.com/u/11982841?v=3","gravatar_id":"","url":"https://api.github.com/users/measurement-kit","html_url":"https://github.com/measurement-kit","followers_url":"https://api.github.com/users/measurement-kit/followers","following_url":"https://api.github.com/users/measurement-kit/following{/other_user}","gists_url":"https://api.github.com/users/measurement-kit/gists{/gist_id}","starred_url":"https://api.github.com/users/measurement-kit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/measurement-kit/subscriptions","organizations_url":"https://api.github.com/users/measurement-kit/orgs","repos_url":"https://api.github.com/users/measurement-kit/repos","events_url":"https://api.github.com/users/measurement-kit/events{/privacy}","received_events_url":"https://api.github.com/users/measurement-kit/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/measurement-kit/measurement-kit","description":"Portable C++11 network measurement library","fork":false,"url":"https://api.github.com/repos/measurement-kit/measurement-kit","forks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/forks","keys_url":"https://api.github.com/repos/measurement-kit/measurement-kit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/measurement-kit/measurement-kit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/measurement-kit/measurement-kit/teams","hooks_url":"https://api.github.com/repos/measurement-kit/measurement-kit/hooks","issue_events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/events{/number}","events_url":"https://api.github.com/repos/measurement-kit/measurement-kit/events","assignees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/assignees{/user}","branches_url":"https://api.github.com/repos/measurement-kit/measurement-kit/branches{/branch}","tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/tags","blobs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/refs{/sha}","trees_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/{sha}","languages_url":"https://api.github.com/repos/measurement-kit/measurement-kit/languages","stargazers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/stargazers","contributors_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contributors","subscribers_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscribers","subscription_url":"https://api.github.com/repos/measurement-kit/measurement-kit/subscription","commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/commits{/sha}","git_commits_url":"https://api.github.com/repos/measurement-kit/measurement-kit/git/commits{/sha}","comments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/comments{/number}","issue_comment_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/comments{/number}","contents_url":"https://api.github.com/repos/measurement-kit/measurement-kit/contents/{+path}","compare_url":"https://api.github.com/repos/measurement-kit/measurement-kit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/measurement-kit/measurement-kit/merges","archive_url":"https://api.github.com/repos/measurement-kit/measurement-kit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/measurement-kit/measurement-kit/downloads","issues_url":"https://api.github.com/repos/measurement-kit/measurement-kit/issues{/number}","pulls_url":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls{/number}","milestones_url":"https://api.github.com/repos/measurement-kit/measurement-kit/milestones{/number}","notifications_url":"https://api.github.com/repos/measurement-kit/measurement-kit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/measurement-kit/measurement-kit/labels{/name}","releases_url":"https://api.github.com/repos/measurement-kit/measurement-kit/releases{/id}","deployments_url":"https://api.github.com/repos/measurement-kit/measurement-kit/deployments","created_at":"2014-05-29T08:44:43Z","updated_at":"2016-11-25T00:32:17Z","pushed_at":"2016-11-29T15:46:02Z","git_url":"git://github.com/measurement-kit/measurement-kit.git","ssh_url":"git@github.com:measurement-kit/measurement-kit.git","clone_url":"https://github.com/measurement-kit/measurement-kit.git","svn_url":"https://github.com/measurement-kit/measurement-kit","homepage":"https://measurement-kit.github.io/","size":12744,"stargazers_count":22,"watchers_count":22,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":91,"forks":6,"open_issues":91,"watchers":22,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/969"},"html":{"href":"https://github.com/measurement-kit/measurement-kit/pull/969"},"issue":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/969"},"comments":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/issues/969/comments"},"review_comments":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/969/comments"},"review_comment":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/pulls/969/commits"},"statuses":{"href":"https://api.github.com/repos/measurement-kit/measurement-kit/statuses/ab7c8b4a427d9102a047d78d7fe5e70889b02558"}}}}
{"actor":{"display_login":"bassosimone"}}