GitHub PullRequestReviewCommentEvent at 2014-11-23 23:25:11
Repository: fossa
Actor: mmikulicic
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/cesanta/fossa/pulls/comments/20769135","id":20769135,"diff_hunk":"@@ -2497,6 +2497,61 @@ void ns_serve_http(struct ns_connection *nc, struct http_message *hm,\n     ns_send_http_file(nc, path, &st);\n   }\n }\n+\n+/*\n+ * Helper function that creates outbound HTTP connection.\n+ *\n+ * If `post_data` is NULL, then GET request is created. Otherwise, POST request\n+ * is created with the specified POST data. Examples:\n+ *\n+ * [source,c]\n+ * ----\n+ *   nc1 = ns_connect_http(mgr, ev_handler_1, \"http://www.google.com\", NULL);\n+ *   nc2 = ns_connect_http(mgr, ev_handler_1, \"https://github.com\", NULL);\n+ *   nc3 = ns_connect_http(mgr, ev_handler_1, \"my_server:8000/form_submit/\",\n+ *                         \"var_1=value_1&var_2=value_2\");\n+ * ----\n+ */\n+struct ns_connection *ns_connect_http(struct ns_mgr *mgr,\n+                                      ns_event_handler_t ev_handler,\n+                                      const char *url, const char *post_data) {\n+  struct ns_connection *nc;\n+  char addr[1100], uri[4096];\n+  int use_ssl = 0;\n+\n+  if (memcmp(url, \"http://\", 7) == 0) {\n+    url += 7;\n+  } else if (memcmp(url, \"https://\", 8) == 0) {\n+    url += 8;\n+    use_ssl = 1;\n+#ifndef NS_ENABLE_SSL\n+#endif\n+  }\n+\n+  addr[0] = uri[0] = '\\0';\n+  sscanf(url, \"%1099[^/]/%4095s\", addr, uri);","path":"fossa.c","position":36,"original_position":36,"commit_id":"7ee45dc8840335ee32e4356aa1587d7fbc0b1dc4","original_commit_id":"7ee45dc8840335ee32e4356aa1587d7fbc0b1dc4","user":{"login":"mmikulicic","id":52673,"avatar_url":"https://avatars.githubusercontent.com/u/52673?v=3","gravatar_id":"","url":"https://api.github.com/users/mmikulicic","html_url":"https://github.com/mmikulicic","followers_url":"https://api.github.com/users/mmikulicic/followers","following_url":"https://api.github.com/users/mmikulicic/following{/other_user}","gists_url":"https://api.github.com/users/mmikulicic/gists{/gist_id}","starred_url":"https://api.github.com/users/mmikulicic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmikulicic/subscriptions","organizations_url":"https://api.github.com/users/mmikulicic/orgs","repos_url":"https://api.github.com/users/mmikulicic/repos","events_url":"https://api.github.com/users/mmikulicic/events{/privacy}","received_events_url":"https://api.github.com/users/mmikulicic/received_events","type":"User","site_admin":false},"body":"perhaps rename uri to `path` or `rest`","created_at":"2014-11-23T23:25:11Z","updated_at":"2014-11-23T23:25:11Z","html_url":"https://github.com/cesanta/fossa/pull/132#discussion_r20769135","pull_request_url":"https://api.github.com/repos/cesanta/fossa/pulls/132","_links":{"self":{"href":"https://api.github.com/repos/cesanta/fossa/pulls/comments/20769135"},"html":{"href":"https://github.com/cesanta/fossa/pull/132#discussion_r20769135"},"pull_request":{"href":"https://api.github.com/repos/cesanta/fossa/pulls/132"}}},"pull_request":{"url":"https://api.github.com/repos/cesanta/fossa/pulls/132","id":24889678,"html_url":"https://github.com/cesanta/fossa/pull/132","diff_url":"https://github.com/cesanta/fossa/pull/132.diff","patch_url":"https://github.com/cesanta/fossa/pull/132.patch","issue_url":"https://api.github.com/repos/cesanta/fossa/issues/132","number":132,"state":"open","locked":false,"title":"Added ns_connect_http() helper function","user":{"login":"cpq","id":601816,"avatar_url":"https://avatars.githubusercontent.com/u/601816?v=3","gravatar_id":"","url":"https://api.github.com/users/cpq","html_url":"https://github.com/cpq","followers_url":"https://api.github.com/users/cpq/followers","following_url":"https://api.github.com/users/cpq/following{/other_user}","gists_url":"https://api.github.com/users/cpq/gists{/gist_id}","starred_url":"https://api.github.com/users/cpq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpq/subscriptions","organizations_url":"https://api.github.com/users/cpq/orgs","repos_url":"https://api.github.com/users/cpq/repos","events_url":"https://api.github.com/users/cpq/events{/privacy}","received_events_url":"https://api.github.com/users/cpq/received_events","type":"User","site_admin":false},"body":"","created_at":"2014-11-22T15:44:29Z","updated_at":"2014-11-23T23:25:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6f432f5c118c08d0547d796bb19b8e7ea0944bb6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cesanta/fossa/pulls/132/commits","review_comments_url":"https://api.github.com/repos/cesanta/fossa/pulls/132/comments","review_comment_url":"https://api.github.com/repos/cesanta/fossa/pulls/comments/{number}","comments_url":"https://api.github.com/repos/cesanta/fossa/issues/132/comments","statuses_url":"https://api.github.com/repos/cesanta/fossa/statuses/7ee45dc8840335ee32e4356aa1587d7fbc0b1dc4","head":{"label":"cesanta:ns_connect_http","ref":"ns_connect_http","sha":"7ee45dc8840335ee32e4356aa1587d7fbc0b1dc4","user":{"login":"cesanta","id":5111322,"avatar_url":"https://avatars.githubusercontent.com/u/5111322?v=3","gravatar_id":"","url":"https://api.github.com/users/cesanta","html_url":"https://github.com/cesanta","followers_url":"https://api.github.com/users/cesanta/followers","following_url":"https://api.github.com/users/cesanta/following{/other_user}","gists_url":"https://api.github.com/users/cesanta/gists{/gist_id}","starred_url":"https://api.github.com/users/cesanta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cesanta/subscriptions","organizations_url":"https://api.github.com/users/cesanta/orgs","repos_url":"https://api.github.com/users/cesanta/repos","events_url":"https://api.github.com/users/cesanta/events{/privacy}","received_events_url":"https://api.github.com/users/cesanta/received_events","type":"Organization","site_admin":false},"repo":{"id":16724014,"name":"fossa","full_name":"cesanta/fossa","owner":{"login":"cesanta","id":5111322,"avatar_url":"https://avatars.githubusercontent.com/u/5111322?v=3","gravatar_id":"","url":"https://api.github.com/users/cesanta","html_url":"https://github.com/cesanta","followers_url":"https://api.github.com/users/cesanta/followers","following_url":"https://api.github.com/users/cesanta/following{/other_user}","gists_url":"https://api.github.com/users/cesanta/gists{/gist_id}","starred_url":"https://api.github.com/users/cesanta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cesanta/subscriptions","organizations_url":"https://api.github.com/users/cesanta/orgs","repos_url":"https://api.github.com/users/cesanta/repos","events_url":"https://api.github.com/users/cesanta/events{/privacy}","received_events_url":"https://api.github.com/users/cesanta/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cesanta/fossa","description":"Async non-blocking multi-protocol networking library for C/C++","fork":false,"url":"https://api.github.com/repos/cesanta/fossa","forks_url":"https://api.github.com/repos/cesanta/fossa/forks","keys_url":"https://api.github.com/repos/cesanta/fossa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cesanta/fossa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cesanta/fossa/teams","hooks_url":"https://api.github.com/repos/cesanta/fossa/hooks","issue_events_url":"https://api.github.com/repos/cesanta/fossa/issues/events{/number}","events_url":"https://api.github.com/repos/cesanta/fossa/events","assignees_url":"https://api.github.com/repos/cesanta/fossa/assignees{/user}","branches_url":"https://api.github.com/repos/cesanta/fossa/branches{/branch}","tags_url":"https://api.github.com/repos/cesanta/fossa/tags","blobs_url":"https://api.github.com/repos/cesanta/fossa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cesanta/fossa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cesanta/fossa/git/refs{/sha}","trees_url":"https://api.github.com/repos/cesanta/fossa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cesanta/fossa/statuses/{sha}","languages_url":"https://api.github.com/repos/cesanta/fossa/languages","stargazers_url":"https://api.github.com/repos/cesanta/fossa/stargazers","contributors_url":"https://api.github.com/repos/cesanta/fossa/contributors","subscribers_url":"https://api.github.com/repos/cesanta/fossa/subscribers","subscription_url":"https://api.github.com/repos/cesanta/fossa/subscription","commits_url":"https://api.github.com/repos/cesanta/fossa/commits{/sha}","git_commits_url":"https://api.github.com/repos/cesanta/fossa/git/commits{/sha}","comments_url":"https://api.github.com/repos/cesanta/fossa/comments{/number}","issue_comment_url":"https://api.github.com/repos/cesanta/fossa/issues/comments/{number}","contents_url":"https://api.github.com/repos/cesanta/fossa/contents/{+path}","compare_url":"https://api.github.com/repos/cesanta/fossa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cesanta/fossa/merges","archive_url":"https://api.github.com/repos/cesanta/fossa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cesanta/fossa/downloads","issues_url":"https://api.github.com/repos/cesanta/fossa/issues{/number}","pulls_url":"https://api.github.com/repos/cesanta/fossa/pulls{/number}","milestones_url":"https://api.github.com/repos/cesanta/fossa/milestones{/number}","notifications_url":"https://api.github.com/repos/cesanta/fossa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cesanta/fossa/labels{/name}","releases_url":"https://api.github.com/repos/cesanta/fossa/releases{/id}","created_at":"2014-02-11T08:21:42Z","updated_at":"2014-11-23T23:09:46Z","pushed_at":"2014-11-23T23:09:49Z","git_url":"git://github.com/cesanta/fossa.git","ssh_url":"git@github.com:cesanta/fossa.git","clone_url":"https://github.com/cesanta/fossa.git","svn_url":"https://github.com/cesanta/fossa","homepage":"http://cesanta.com","size":7990,"stargazers_count":58,"watchers_count":58,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":20,"forks":24,"open_issues":20,"watchers":58,"default_branch":"master"}},"base":{"label":"cesanta:master","ref":"master","sha":"e664dbab703ffe8fc4d2166bf460731c51ac564e","user":{"login":"cesanta","id":5111322,"avatar_url":"https://avatars.githubusercontent.com/u/5111322?v=3","gravatar_id":"","url":"https://api.github.com/users/cesanta","html_url":"https://github.com/cesanta","followers_url":"https://api.github.com/users/cesanta/followers","following_url":"https://api.github.com/users/cesanta/following{/other_user}","gists_url":"https://api.github.com/users/cesanta/gists{/gist_id}","starred_url":"https://api.github.com/users/cesanta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cesanta/subscriptions","organizations_url":"https://api.github.com/users/cesanta/orgs","repos_url":"https://api.github.com/users/cesanta/repos","events_url":"https://api.github.com/users/cesanta/events{/privacy}","received_events_url":"https://api.github.com/users/cesanta/received_events","type":"Organization","site_admin":false},"repo":{"id":16724014,"name":"fossa","full_name":"cesanta/fossa","owner":{"login":"cesanta","id":5111322,"avatar_url":"https://avatars.githubusercontent.com/u/5111322?v=3","gravatar_id":"","url":"https://api.github.com/users/cesanta","html_url":"https://github.com/cesanta","followers_url":"https://api.github.com/users/cesanta/followers","following_url":"https://api.github.com/users/cesanta/following{/other_user}","gists_url":"https://api.github.com/users/cesanta/gists{/gist_id}","starred_url":"https://api.github.com/users/cesanta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cesanta/subscriptions","organizations_url":"https://api.github.com/users/cesanta/orgs","repos_url":"https://api.github.com/users/cesanta/repos","events_url":"https://api.github.com/users/cesanta/events{/privacy}","received_events_url":"https://api.github.com/users/cesanta/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cesanta/fossa","description":"Async non-blocking multi-protocol networking library for C/C++","fork":false,"url":"https://api.github.com/repos/cesanta/fossa","forks_url":"https://api.github.com/repos/cesanta/fossa/forks","keys_url":"https://api.github.com/repos/cesanta/fossa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cesanta/fossa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cesanta/fossa/teams","hooks_url":"https://api.github.com/repos/cesanta/fossa/hooks","issue_events_url":"https://api.github.com/repos/cesanta/fossa/issues/events{/number}","events_url":"https://api.github.com/repos/cesanta/fossa/events","assignees_url":"https://api.github.com/repos/cesanta/fossa/assignees{/user}","branches_url":"https://api.github.com/repos/cesanta/fossa/branches{/branch}","tags_url":"https://api.github.com/repos/cesanta/fossa/tags","blobs_url":"https://api.github.com/repos/cesanta/fossa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cesanta/fossa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cesanta/fossa/git/refs{/sha}","trees_url":"https://api.github.com/repos/cesanta/fossa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cesanta/fossa/statuses/{sha}","languages_url":"https://api.github.com/repos/cesanta/fossa/languages","stargazers_url":"https://api.github.com/repos/cesanta/fossa/stargazers","contributors_url":"https://api.github.com/repos/cesanta/fossa/contributors","subscribers_url":"https://api.github.com/repos/cesanta/fossa/subscribers","subscription_url":"https://api.github.com/repos/cesanta/fossa/subscription","commits_url":"https://api.github.com/repos/cesanta/fossa/commits{/sha}","git_commits_url":"https://api.github.com/repos/cesanta/fossa/git/commits{/sha}","comments_url":"https://api.github.com/repos/cesanta/fossa/comments{/number}","issue_comment_url":"https://api.github.com/repos/cesanta/fossa/issues/comments/{number}","contents_url":"https://api.github.com/repos/cesanta/fossa/contents/{+path}","compare_url":"https://api.github.com/repos/cesanta/fossa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cesanta/fossa/merges","archive_url":"https://api.github.com/repos/cesanta/fossa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cesanta/fossa/downloads","issues_url":"https://api.github.com/repos/cesanta/fossa/issues{/number}","pulls_url":"https://api.github.com/repos/cesanta/fossa/pulls{/number}","milestones_url":"https://api.github.com/repos/cesanta/fossa/milestones{/number}","notifications_url":"https://api.github.com/repos/cesanta/fossa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cesanta/fossa/labels{/name}","releases_url":"https://api.github.com/repos/cesanta/fossa/releases{/id}","created_at":"2014-02-11T08:21:42Z","updated_at":"2014-11-23T23:09:46Z","pushed_at":"2014-11-23T23:09:49Z","git_url":"git://github.com/cesanta/fossa.git","ssh_url":"git@github.com:cesanta/fossa.git","clone_url":"https://github.com/cesanta/fossa.git","svn_url":"https://github.com/cesanta/fossa","homepage":"http://cesanta.com","size":7990,"stargazers_count":58,"watchers_count":58,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"open_issues_count":20,"forks":24,"open_issues":20,"watchers":58,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cesanta/fossa/pulls/132"},"html":{"href":"https://github.com/cesanta/fossa/pull/132"},"issue":{"href":"https://api.github.com/repos/cesanta/fossa/issues/132"},"comments":{"href":"https://api.github.com/repos/cesanta/fossa/issues/132/comments"},"review_comments":{"href":"https://api.github.com/repos/cesanta/fossa/pulls/132/comments"},"review_comment":{"href":"https://api.github.com/repos/cesanta/fossa/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/cesanta/fossa/pulls/132/commits"},"statuses":{"href":"https://api.github.com/repos/cesanta/fossa/statuses/7ee45dc8840335ee32e4356aa1587d7fbc0b1dc4"}}}}