{"action":"created","comment":{"url":"https://api.github.com/repos/litespeedtech/lsquic-client/pulls/comments/187701858","pull_request_review_id":119542121,"id":187701858,"diff_hunk":"@@ -219,44 +273,65 @@ sport_new (const char *optarg, struct prog *prog)\n     sport->packs_in = NULL;\n     sport->fd = -1;\n     char *const addr = strdup(optarg);\n+    char ip[INET6_ADDRSTRLEN];\n #if __linux__\n     char *if_name;\n     if_name = strrchr(addr, ',');\n     if (if_name)\n     {\n         strncpy(sport->if_name, if_name + 1, sizeof(sport->if_name) - 1);\n-        sport->if_name[ sizeof(sport->if_name) - 1 ] = '\\0';\n+        sport->if_name[sizeof(sport->if_name) - 1] = '\\0';\n         *if_name = '\\0';\n     }\n     else\n         sport->if_name[0] = '\\0';\n #endif\n     char *port = strrchr(addr, ':');\n-    if (!port)\n-        goto err;\n-    *port = '\\0';\n-    ++port;\n-    if ((uintptr_t) port - (uintptr_t) addr > sizeof(sport->host))\n-        goto err;\n-    memcpy(sport->host, addr, port - addr);\n+    if (!port)/*IpAdress wasn't specified by the user*/\n+    {\n+        if (get_Ip_from_DNS(prog->prog_hostname, ip, ipv6, addr, INET6_ADDRSTRLEN) == 1)\n+        {\n+            LSQ_ERROR(\"Couldn't resolve the hostname.\\n\");\n+            goto err;\n+        }\n+        port = strdup(optarg);\n+\n+        memcpy(sport->host, ip, sizeof(ip));\n+    }\n+    else /*The user specified an ipaddress*/","path":"test/test_common.c","position":98,"original_position":98,"commit_id":"2909d4dcc52ae89f03695ddaaa24a223b68ae58c","original_commit_id":"2909d4dcc52ae89f03695ddaaa24a223b68ae58c","user":{"login":"dtikhonov","id":4528576,"avatar_url":"https://avatars1.githubusercontent.com/u/4528576?v=4","gravatar_id":"","url":"https://api.github.com/users/dtikhonov","html_url":"https://github.com/dtikhonov","followers_url":"https://api.github.com/users/dtikhonov/followers","following_url":"https://api.github.com/users/dtikhonov/following{/other_user}","gists_url":"https://api.github.com/users/dtikhonov/gists{/gist_id}","starred_url":"https://api.github.com/users/dtikhonov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dtikhonov/subscriptions","organizations_url":"https://api.github.com/users/dtikhonov/orgs","repos_url":"https://api.github.com/users/dtikhonov/repos","events_url":"https://api.github.com/users/dtikhonov/events{/privacy}","received_events_url":"https://api.github.com/users/dtikhonov/received_events","type":"User","site_admin":false},"body":"It could be either an IP address (`-s 1.2.3.4:443`) or a hostname (`-s example.com:443`).  If both `inet_pton()` calls fail, it must be a hostname.","created_at":"2018-05-11T18:48:43Z","updated_at":"2018-05-11T18:48:44Z","html_url":"https://github.com/litespeedtech/lsquic-client/pull/30#discussion_r187701858","pull_request_url":"https://api.github.com/repos/litespeedtech/lsquic-client/pulls/30","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/litespeedtech/lsquic-client/pulls/comments/187701858"},"html":{"href":"https://github.com/litespeedtech/lsquic-client/pull/30#discussion_r187701858"},"pull_request":{"href":"https://api.github.com/repos/litespeedtech/lsquic-client/pulls/30"}},"in_reply_to_id":187689035},"pull_request":{"url":"https://api.github.com/repos/litespeedtech/lsquic-client/pulls/30","id":186704046,"html_url":"https://github.com/litespeedtech/lsquic-client/pull/30","diff_url":"https://github.com/litespeedtech/lsquic-client/pull/30.diff","patch_url":"https://github.com/litespeedtech/lsquic-client/pull/30.patch","issue_url":"https://api.github.com/repos/litespeedtech/lsquic-client/issues/30","number":30,"state":"open","locked":false,"title":"Dns resolution","user":{"login":"Kait0","id":4252687,"avatar_url":"https://avatars1.githubusercontent.com/u/4252687?v=4","gravatar_id":"","url":"https://api.github.com/users/Kait0","html_url":"https://github.com/Kait0","followers_url":"https://api.github.com/users/Kait0/followers","following_url":"https://api.github.com/users/Kait0/following{/other_user}","gists_url":"https://api.github.com/users/Kait0/gists{/gist_id}","starred_url":"https://api.github.com/users/Kait0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kait0/subscriptions","organizations_url":"https://api.github.com/users/Kait0/orgs","repos_url":"https://api.github.com/users/Kait0/repos","events_url":"https://api.github.com/users/Kait0/events{/privacy}","received_events_url":"https://api.github.com/users/Kait0/received_events","type":"User","site_admin":false},"body":"The client now automatically determines the ipadress of the url given with the -H flag\r\nThe -s flag now only expects the port\r\nThe standard ip version is IPv4. To make the client use IPv6 use the -v flag\r\n\r\nKnown limitations:\r\n- The -v flag needs to be entered before -s in order to work\r\n- The client successfully retrieves an IPv6 adress but I could not test wether it can actually connect since I do not have an IPv6 connection.\r\n- I had to discard changes made to sport_new() in test_common.c recently since the function now works differently. \r\n","created_at":"2018-05-08T17:32:28Z","updated_at":"2018-05-11T18:48:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b16ca2fa5115d2d32ca23983a330e331de17c93d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/litespeedtech/lsquic-client/pulls/30/commits","review_comments_url":"https://api.github.com/repos/litespeedtech/lsquic-client/pulls/30/comments","review_comment_url":"https://api.github.com/repos/litespeedtech/lsquic-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/litespeedtech/lsquic-client/issues/30/comments","statuses_url":"https://api.github.com/repos/litespeedtech/lsquic-client/statuses/2909d4dcc52ae89f03695ddaaa24a223b68ae58c","head":{"label":"Kait0:DNSResolution","ref":"DNSResolution","sha":"2909d4dcc52ae89f03695ddaaa24a223b68ae58c","user":{"login":"Kait0","id":4252687,"avatar_url":"https://avatars1.githubusercontent.com/u/4252687?v=4","gravatar_id":"","url":"https://api.github.com/users/Kait0","html_url":"https://github.com/Kait0","followers_url":"https://api.github.com/users/Kait0/followers","following_url":"https://api.github.com/users/Kait0/following{/other_user}","gists_url":"https://api.github.com/users/Kait0/gists{/gist_id}","starred_url":"https://api.github.com/users/Kait0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kait0/subscriptions","organizations_url":"https://api.github.com/users/Kait0/orgs","repos_url":"https://api.github.com/users/Kait0/repos","events_url":"https://api.github.com/users/Kait0/events{/privacy}","received_events_url":"https://api.github.com/users/Kait0/received_events","type":"User","site_admin":false},"repo":{"id":130710803,"name":"lsquic-client","full_name":"Kait0/lsquic-client","owner":{"login":"Kait0","id":4252687,"avatar_url":"https://avatars1.githubusercontent.com/u/4252687?v=4","gravatar_id":"","url":"https://api.github.com/users/Kait0","html_url":"https://github.com/Kait0","followers_url":"https://api.github.com/users/Kait0/followers","following_url":"https://api.github.com/users/Kait0/following{/other_user}","gists_url":"https://api.github.com/users/Kait0/gists{/gist_id}","starred_url":"https://api.github.com/users/Kait0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Kait0/subscriptions","organizations_url":"https://api.github.com/users/Kait0/orgs","repos_url":"https://api.github.com/users/Kait0/repos","events_url":"https://api.github.com/users/Kait0/events{/privacy}","received_events_url":"https://api.github.com/users/Kait0/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Kait0/lsquic-client","description":"LiteSpeed QUIC Client Library","fork":true,"url":"https://api.github.com/repos/Kait0/lsquic-client","forks_url":"https://api.github.com/repos/Kait0/lsquic-client/forks","keys_url":"https://api.github.com/repos/Kait0/lsquic-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Kait0/lsquic-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Kait0/lsquic-client/teams","hooks_url":"https://api.github.com/repos/Kait0/lsquic-client/hooks","issue_events_url":"https://api.github.com/repos/Kait0/lsquic-client/issues/events{/number}","events_url":"https://api.github.com/repos/Kait0/lsquic-client/events","assignees_url":"https://api.github.com/repos/Kait0/lsquic-client/assignees{/user}","branches_url":"https://api.github.com/repos/Kait0/lsquic-client/branches{/branch}","tags_url":"https://api.github.com/repos/Kait0/lsquic-client/tags","blobs_url":"https://api.github.com/repos/Kait0/lsquic-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Kait0/lsquic-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Kait0/lsquic-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/Kait0/lsquic-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Kait0/lsquic-client/statuses/{sha}","languages_url":"https://api.github.com/repos/Kait0/lsquic-client/languages","stargazers_url":"https://api.github.com/repos/Kait0/lsquic-client/stargazers","contributors_url":"https://api.github.com/repos/Kait0/lsquic-client/contributors","subscribers_url":"https://api.github.com/repos/Kait0/lsquic-client/subscribers","subscription_url":"https://api.github.com/repos/Kait0/lsquic-client/subscription","commits_url":"https://api.github.com/repos/Kait0/lsquic-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/Kait0/lsquic-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/Kait0/lsquic-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/Kait0/lsquic-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/Kait0/lsquic-client/contents/{+path}","compare_url":"https://api.github.com/repos/Kait0/lsquic-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Kait0/lsquic-client/merges","archive_url":"https://api.github.com/repos/Kait0/lsquic-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Kait0/lsquic-client/downloads","issues_url":"https://api.github.com/repos/Kait0/lsquic-client/issues{/number}","pulls_url":"https://api.github.com/repos/Kait0/lsquic-client/pulls{/number}","milestones_url":"https://api.github.com/repos/Kait0/lsquic-client/milestones{/number}","notifications_url":"https://api.github.com/repos/Kait0/lsquic-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Kait0/lsquic-client/labels{/name}","releases_url":"https://api.github.com/repos/Kait0/lsquic-client/releases{/id}","deployments_url":"https://api.github.com/repos/Kait0/lsquic-client/deployments","created_at":"2018-04-23T14:36:45Z","updated_at":"2018-05-07T17:20:29Z","pushed_at":"2018-05-11T13:50:11Z","git_url":"git://github.com/Kait0/lsquic-client.git","ssh_url":"git@github.com:Kait0/lsquic-client.git","clone_url":"https://github.com/Kait0/lsquic-client.git","svn_url":"https://github.com/Kait0/lsquic-client","homepage":"","size":2038,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"litespeedtech:master","ref":"master","sha":"1cd65f769fb1371994c797c4d86445abd9151b6c","user":{"login":"litespeedtech","id":4990456,"avatar_url":"https://avatars0.githubusercontent.com/u/4990456?v=4","gravatar_id":"","url":"https://api.github.com/users/litespeedtech","html_url":"https://github.com/litespeedtech","followers_url":"https://api.github.com/users/litespeedtech/followers","following_url":"https://api.github.com/users/litespeedtech/following{/other_user}","gists_url":"https://api.github.com/users/litespeedtech/gists{/gist_id}","starred_url":"https://api.github.com/users/litespeedtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/litespeedtech/subscriptions","organizations_url":"https://api.github.com/users/litespeedtech/orgs","repos_url":"https://api.github.com/users/litespeedtech/repos","events_url":"https://api.github.com/users/litespeedtech/events{/privacy}","received_events_url":"https://api.github.com/users/litespeedtech/received_events","type":"User","site_admin":false},"repo":{"id":104516416,"name":"lsquic-client","full_name":"litespeedtech/lsquic-client","owner":{"login":"litespeedtech","id":4990456,"avatar_url":"https://avatars0.githubusercontent.com/u/4990456?v=4","gravatar_id":"","url":"https://api.github.com/users/litespeedtech","html_url":"https://github.com/litespeedtech","followers_url":"https://api.github.com/users/litespeedtech/followers","following_url":"https://api.github.com/users/litespeedtech/following{/other_user}","gists_url":"https://api.github.com/users/litespeedtech/gists{/gist_id}","starred_url":"https://api.github.com/users/litespeedtech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/litespeedtech/subscriptions","organizations_url":"https://api.github.com/users/litespeedtech/orgs","repos_url":"https://api.github.com/users/litespeedtech/repos","events_url":"https://api.github.com/users/litespeedtech/events{/privacy}","received_events_url":"https://api.github.com/users/litespeedtech/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/litespeedtech/lsquic-client","description":"LiteSpeed QUIC Client Library","fork":false,"url":"https://api.github.com/repos/litespeedtech/lsquic-client","forks_url":"https://api.github.com/repos/litespeedtech/lsquic-client/forks","keys_url":"https://api.github.com/repos/litespeedtech/lsquic-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/litespeedtech/lsquic-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/litespeedtech/lsquic-client/teams","hooks_url":"https://api.github.com/repos/litespeedtech/lsquic-client/hooks","issue_events_url":"https://api.github.com/repos/litespeedtech/lsquic-client/issues/events{/number}","events_url":"https://api.github.com/repos/litespeedtech/lsquic-client/events","assignees_url":"https://api.github.com/repos/litespeedtech/lsquic-client/assignees{/user}","branches_url":"https://api.github.com/repos/litespeedtech/lsquic-client/branches{/branch}","tags_url":"https://api.github.com/repos/litespeedtech/lsquic-client/tags","blobs_url":"https://api.github.com/repos/litespeedtech/lsquic-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/litespeedtech/lsquic-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/litespeedtech/lsquic-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/litespeedtech/lsquic-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/litespeedtech/lsquic-client/statuses/{sha}","languages_url":"https://api.github.com/repos/litespeedtech/lsquic-client/languages","stargazers_url":"https://api.github.com/repos/litespeedtech/lsquic-client/stargazers","contributors_url":"https://api.github.com/repos/litespeedtech/lsquic-client/contributors","subscribers_url":"https://api.github.com/repos/litespeedtech/lsquic-client/subscribers","subscription_url":"https://api.github.com/repos/litespeedtech/lsquic-client/subscription","commits_url":"https://api.github.com/repos/litespeedtech/lsquic-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/litespeedtech/lsquic-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/litespeedtech/lsquic-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/litespeedtech/lsquic-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/litespeedtech/lsquic-client/contents/{+path}","compare_url":"https://api.github.com/repos/litespeedtech/lsquic-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/litespeedtech/lsquic-client/merges","archive_url":"https://api.github.com/repos/litespeedtech/lsquic-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/litespeedtech/lsquic-client/downloads","issues_url":"https://api.github.com/repos/litespeedtech/lsquic-client/issues{/number}","pulls_url":"https://api.github.com/repos/litespeedtech/lsquic-client/pulls{/number}","milestones_url":"https://api.github.com/repos/litespeedtech/lsquic-client/milestones{/number}","notifications_url":"https://api.github.com/repos/litespeedtech/lsquic-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/litespeedtech/lsquic-client/labels{/name}","releases_url":"https://api.github.com/repos/litespeedtech/lsquic-client/releases{/id}","deployments_url":"https://api.github.com/repos/litespeedtech/lsquic-client/deployments","created_at":"2017-09-22T20:33:18Z","updated_at":"2018-05-11T12:20:27Z","pushed_at":"2018-05-11T13:50:13Z","git_url":"git://github.com/litespeedtech/lsquic-client.git","ssh_url":"git@github.com:litespeedtech/lsquic-client.git","clone_url":"https://github.com/litespeedtech/lsquic-client.git","svn_url":"https://github.com/litespeedtech/lsquic-client","homepage":"","size":2023,"stargazers_count":63,"watchers_count":63,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":8,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":18,"open_issues":8,"watchers":63,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/litespeedtech/lsquic-client/pulls/30"},"html":{"href":"https://github.com/litespeedtech/lsquic-client/pull/30"},"issue":{"href":"https://api.github.com/repos/litespeedtech/lsquic-client/issues/30"},"comments":{"href":"https://api.github.com/repos/litespeedtech/lsquic-client/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/litespeedtech/lsquic-client/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/litespeedtech/lsquic-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/litespeedtech/lsquic-client/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/litespeedtech/lsquic-client/statuses/2909d4dcc52ae89f03695ddaaa24a223b68ae58c"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"dtikhonov"}}