{"action":"created","comment":{"url":"https://api.github.com/repos/Samsung/TizenRT/pulls/comments/201989327","pull_request_review_id":136594976,"id":201989327,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMTk4OTMyNw==","diff_hunk":"@@ -83,42 +80,30 @@ int CICheckDomain(const char *DomainName, char **pIP)\n \t\t}\n \t} \n \n-\tTHINGS_LOG_E(TAG, \" Failed to get the IP, hard coding the ip\");\n-\tsnprintf(ipbuffer, sizeof(ipbuffer), \"%s\", \"13.124.51.231\");\n-\n-\tusleep(500);\n-\tif (pIP != NULL) {\n-\t\t*pIP = things_strdup(ipbuffer);\n-\t}\n+\tTHINGS_LOG_E(TAG, \" Failed to get the IP\");\n \n-\treturn 0;\n+\treturn -1;\n }\n \n /**\n  * @brief              Entry Point for checking about internet & Cloud connection.\n  * @param DomainName   wanted Domain-Name string to look-up IP address. (unit: const char*)\n  * @param pIP          Variable pointer to store Founded IP address. (unit: char**)\n  * @return             success : return 0 \\n\n- *                     failure : return > 0\n+ *                     failure : return -1\n  */\n int ci_connection_pre_check(const char *DomainName, char **pIP)\n {\n-\tint n_err = 0;\t\t\t\t// Success return value\n-\n \tTHINGS_LOG_D(TAG, \"DomainName=%s, pIP=0x%X\", DomainName, pIP);\n-\n-\tif (CICheckDomain(\"samsung.com\", NULL) != 0) {\n-\t\tif (DomainName == NULL) {\n-\t\t\tTHINGS_LOG_E(TAG, \"AP is Not Connected to Internet.\");\n-\t\t\treturn -1;\n-\t\t}\n-\t}\n-\n-\tif (DomainName != NULL) {\n+\tint n_err = 0;\n+\tn_err = CICheckDomain(\"samsung.com\", NULL);\n+\tif (n_err == -1) {\n+\t\treturn -1;\n+\t} else if (n_err == 0 && DomainName != NULL) {\n \t\tn_err = CICheckDomain(DomainName, pIP);\n \t\tTHINGS_LOG_D(TAG, \"Found IP = %s, n_err = %d\", *pIP, n_err);\n \t}\n-\n+\t","path":"framework/src/st_things/things_stack/cloud/cloud_connector.c","position":70,"original_position":70,"commit_id":"7a1b6edc905a73046c61c5181b7e4c3e84ccd8bf","original_commit_id":"71c540251f7d8001e06171458470f2ca6f0c02fa","user":{"login":"Taejun-Kwon","id":25811447,"node_id":"MDQ6VXNlcjI1ODExNDQ3","avatar_url":"https://avatars1.githubusercontent.com/u/25811447?v=4","gravatar_id":"","url":"https://api.github.com/users/Taejun-Kwon","html_url":"https://github.com/Taejun-Kwon","followers_url":"https://api.github.com/users/Taejun-Kwon/followers","following_url":"https://api.github.com/users/Taejun-Kwon/following{/other_user}","gists_url":"https://api.github.com/users/Taejun-Kwon/gists{/gist_id}","starred_url":"https://api.github.com/users/Taejun-Kwon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Taejun-Kwon/subscriptions","organizations_url":"https://api.github.com/users/Taejun-Kwon/orgs","repos_url":"https://api.github.com/users/Taejun-Kwon/repos","events_url":"https://api.github.com/users/Taejun-Kwon/events{/privacy}","received_events_url":"https://api.github.com/users/Taejun-Kwon/received_events","type":"User","site_admin":false},"body":"To understand code more easily, how about below?\r\n```\r\nint n_err = -1;\r\nn_err = CICheckDomain(\"samsung.com\", NULL);\r\nif (n_err != 0) {\r\n    THINGS_LOG_E(TAG, \"AP is Not Connected to Internet\");\r\n    return n_err;\r\n}\r\n/** If AP Connected but DomainName is Null, do not check Domain return Success **/\r\nif (DomainName == NULL) {\r\n    THINGS_LOG_V(TAG, \"AP Connected but DomainName is Null\\n\");\r\n     n_err = 0;\r\n} else {\r\n    n_err = CICheckDomain(DomainName, pIP);\r\n    THINGS_LOG_D(TAG, \"Found IP = %s, n_err = %d\", *pIP, n_err);\r\n}\r\nreturn n_err;\r\n```","created_at":"2018-07-12T10:42:03Z","updated_at":"2018-07-12T10:42:04Z","html_url":"https://github.com/Samsung/TizenRT/pull/1925#discussion_r201989327","pull_request_url":"https://api.github.com/repos/Samsung/TizenRT/pulls/1925","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Samsung/TizenRT/pulls/comments/201989327"},"html":{"href":"https://github.com/Samsung/TizenRT/pull/1925#discussion_r201989327"},"pull_request":{"href":"https://api.github.com/repos/Samsung/TizenRT/pulls/1925"}},"in_reply_to_id":201982797},"pull_request":{"url":"https://api.github.com/repos/Samsung/TizenRT/pulls/1925","id":200893299,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwODkzMjk5","html_url":"https://github.com/Samsung/TizenRT/pull/1925","diff_url":"https://github.com/Samsung/TizenRT/pull/1925.diff","patch_url":"https://github.com/Samsung/TizenRT/pull/1925.patch","issue_url":"https://api.github.com/repos/Samsung/TizenRT/issues/1925","number":1925,"state":"open","locked":false,"title":"framework/st_things : Fix unnecessary cloud connectivity logic","user":{"login":"JeongJunSik","id":25924775,"node_id":"MDQ6VXNlcjI1OTI0Nzc1","avatar_url":"https://avatars1.githubusercontent.com/u/25924775?v=4","gravatar_id":"","url":"https://api.github.com/users/JeongJunSik","html_url":"https://github.com/JeongJunSik","followers_url":"https://api.github.com/users/JeongJunSik/followers","following_url":"https://api.github.com/users/JeongJunSik/following{/other_user}","gists_url":"https://api.github.com/users/JeongJunSik/gists{/gist_id}","starred_url":"https://api.github.com/users/JeongJunSik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeongJunSik/subscriptions","organizations_url":"https://api.github.com/users/JeongJunSik/orgs","repos_url":"https://api.github.com/users/JeongJunSik/repos","events_url":"https://api.github.com/users/JeongJunSik/events{/privacy}","received_events_url":"https://api.github.com/users/JeongJunSik/received_events","type":"User","site_admin":false},"body":"- Unnecessary Logic Cleanup (Default Server)\r\n- Remove unused logic","created_at":"2018-07-12T05:44:03Z","updated_at":"2018-07-12T10:42:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3222ab7b1f565e9d4ece194c80b6bd8f88e53da6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Samsung/TizenRT/pulls/1925/commits","review_comments_url":"https://api.github.com/repos/Samsung/TizenRT/pulls/1925/comments","review_comment_url":"https://api.github.com/repos/Samsung/TizenRT/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Samsung/TizenRT/issues/1925/comments","statuses_url":"https://api.github.com/repos/Samsung/TizenRT/statuses/7a1b6edc905a73046c61c5181b7e4c3e84ccd8bf","head":{"label":"JeongJunSik:0711_cloud_logic_cleanup","ref":"0711_cloud_logic_cleanup","sha":"7a1b6edc905a73046c61c5181b7e4c3e84ccd8bf","user":{"login":"JeongJunSik","id":25924775,"node_id":"MDQ6VXNlcjI1OTI0Nzc1","avatar_url":"https://avatars1.githubusercontent.com/u/25924775?v=4","gravatar_id":"","url":"https://api.github.com/users/JeongJunSik","html_url":"https://github.com/JeongJunSik","followers_url":"https://api.github.com/users/JeongJunSik/followers","following_url":"https://api.github.com/users/JeongJunSik/following{/other_user}","gists_url":"https://api.github.com/users/JeongJunSik/gists{/gist_id}","starred_url":"https://api.github.com/users/JeongJunSik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeongJunSik/subscriptions","organizations_url":"https://api.github.com/users/JeongJunSik/orgs","repos_url":"https://api.github.com/users/JeongJunSik/repos","events_url":"https://api.github.com/users/JeongJunSik/events{/privacy}","received_events_url":"https://api.github.com/users/JeongJunSik/received_events","type":"User","site_admin":false},"repo":{"id":97448406,"node_id":"MDEwOlJlcG9zaXRvcnk5NzQ0ODQwNg==","name":"TizenRT","full_name":"JeongJunSik/TizenRT","owner":{"login":"JeongJunSik","id":25924775,"node_id":"MDQ6VXNlcjI1OTI0Nzc1","avatar_url":"https://avatars1.githubusercontent.com/u/25924775?v=4","gravatar_id":"","url":"https://api.github.com/users/JeongJunSik","html_url":"https://github.com/JeongJunSik","followers_url":"https://api.github.com/users/JeongJunSik/followers","following_url":"https://api.github.com/users/JeongJunSik/following{/other_user}","gists_url":"https://api.github.com/users/JeongJunSik/gists{/gist_id}","starred_url":"https://api.github.com/users/JeongJunSik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JeongJunSik/subscriptions","organizations_url":"https://api.github.com/users/JeongJunSik/orgs","repos_url":"https://api.github.com/users/JeongJunSik/repos","events_url":"https://api.github.com/users/JeongJunSik/events{/privacy}","received_events_url":"https://api.github.com/users/JeongJunSik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JeongJunSik/TizenRT","description":"Tizen RT is a lightweight RTOS-based platform to support low-end IoT devices","fork":true,"url":"https://api.github.com/repos/JeongJunSik/TizenRT","forks_url":"https://api.github.com/repos/JeongJunSik/TizenRT/forks","keys_url":"https://api.github.com/repos/JeongJunSik/TizenRT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JeongJunSik/TizenRT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JeongJunSik/TizenRT/teams","hooks_url":"https://api.github.com/repos/JeongJunSik/TizenRT/hooks","issue_events_url":"https://api.github.com/repos/JeongJunSik/TizenRT/issues/events{/number}","events_url":"https://api.github.com/repos/JeongJunSik/TizenRT/events","assignees_url":"https://api.github.com/repos/JeongJunSik/TizenRT/assignees{/user}","branches_url":"https://api.github.com/repos/JeongJunSik/TizenRT/branches{/branch}","tags_url":"https://api.github.com/repos/JeongJunSik/TizenRT/tags","blobs_url":"https://api.github.com/repos/JeongJunSik/TizenRT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JeongJunSik/TizenRT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JeongJunSik/TizenRT/git/refs{/sha}","trees_url":"https://api.github.com/repos/JeongJunSik/TizenRT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JeongJunSik/TizenRT/statuses/{sha}","languages_url":"https://api.github.com/repos/JeongJunSik/TizenRT/languages","stargazers_url":"https://api.github.com/repos/JeongJunSik/TizenRT/stargazers","contributors_url":"https://api.github.com/repos/JeongJunSik/TizenRT/contributors","subscribers_url":"https://api.github.com/repos/JeongJunSik/TizenRT/subscribers","subscription_url":"https://api.github.com/repos/JeongJunSik/TizenRT/subscription","commits_url":"https://api.github.com/repos/JeongJunSik/TizenRT/commits{/sha}","git_commits_url":"https://api.github.com/repos/JeongJunSik/TizenRT/git/commits{/sha}","comments_url":"https://api.github.com/repos/JeongJunSik/TizenRT/comments{/number}","issue_comment_url":"https://api.github.com/repos/JeongJunSik/TizenRT/issues/comments{/number}","contents_url":"https://api.github.com/repos/JeongJunSik/TizenRT/contents/{+path}","compare_url":"https://api.github.com/repos/JeongJunSik/TizenRT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JeongJunSik/TizenRT/merges","archive_url":"https://api.github.com/repos/JeongJunSik/TizenRT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JeongJunSik/TizenRT/downloads","issues_url":"https://api.github.com/repos/JeongJunSik/TizenRT/issues{/number}","pulls_url":"https://api.github.com/repos/JeongJunSik/TizenRT/pulls{/number}","milestones_url":"https://api.github.com/repos/JeongJunSik/TizenRT/milestones{/number}","notifications_url":"https://api.github.com/repos/JeongJunSik/TizenRT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JeongJunSik/TizenRT/labels{/name}","releases_url":"https://api.github.com/repos/JeongJunSik/TizenRT/releases{/id}","deployments_url":"https://api.github.com/repos/JeongJunSik/TizenRT/deployments","created_at":"2017-07-17T07:37:50Z","updated_at":"2017-07-17T07:38:07Z","pushed_at":"2018-07-12T10:24:21Z","git_url":"git://github.com/JeongJunSik/TizenRT.git","ssh_url":"git@github.com:JeongJunSik/TizenRT.git","clone_url":"https://github.com/JeongJunSik/TizenRT.git","svn_url":"https://github.com/JeongJunSik/TizenRT","homepage":"","size":101012,"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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Samsung:master","ref":"master","sha":"12c5c0005d1031984a5b7202b770ae4628d41a91","user":{"login":"Samsung","id":6210390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMTAzOTA=","avatar_url":"https://avatars3.githubusercontent.com/u/6210390?v=4","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"repo":{"id":82517252,"node_id":"MDEwOlJlcG9zaXRvcnk4MjUxNzI1Mg==","name":"TizenRT","full_name":"Samsung/TizenRT","owner":{"login":"Samsung","id":6210390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYyMTAzOTA=","avatar_url":"https://avatars3.githubusercontent.com/u/6210390?v=4","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Samsung/TizenRT","description":"TizenRT is a lightweight RTOS-based platform to support low-end IoT devices","fork":false,"url":"https://api.github.com/repos/Samsung/TizenRT","forks_url":"https://api.github.com/repos/Samsung/TizenRT/forks","keys_url":"https://api.github.com/repos/Samsung/TizenRT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Samsung/TizenRT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Samsung/TizenRT/teams","hooks_url":"https://api.github.com/repos/Samsung/TizenRT/hooks","issue_events_url":"https://api.github.com/repos/Samsung/TizenRT/issues/events{/number}","events_url":"https://api.github.com/repos/Samsung/TizenRT/events","assignees_url":"https://api.github.com/repos/Samsung/TizenRT/assignees{/user}","branches_url":"https://api.github.com/repos/Samsung/TizenRT/branches{/branch}","tags_url":"https://api.github.com/repos/Samsung/TizenRT/tags","blobs_url":"https://api.github.com/repos/Samsung/TizenRT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Samsung/TizenRT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Samsung/TizenRT/git/refs{/sha}","trees_url":"https://api.github.com/repos/Samsung/TizenRT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Samsung/TizenRT/statuses/{sha}","languages_url":"https://api.github.com/repos/Samsung/TizenRT/languages","stargazers_url":"https://api.github.com/repos/Samsung/TizenRT/stargazers","contributors_url":"https://api.github.com/repos/Samsung/TizenRT/contributors","subscribers_url":"https://api.github.com/repos/Samsung/TizenRT/subscribers","subscription_url":"https://api.github.com/repos/Samsung/TizenRT/subscription","commits_url":"https://api.github.com/repos/Samsung/TizenRT/commits{/sha}","git_commits_url":"https://api.github.com/repos/Samsung/TizenRT/git/commits{/sha}","comments_url":"https://api.github.com/repos/Samsung/TizenRT/comments{/number}","issue_comment_url":"https://api.github.com/repos/Samsung/TizenRT/issues/comments{/number}","contents_url":"https://api.github.com/repos/Samsung/TizenRT/contents/{+path}","compare_url":"https://api.github.com/repos/Samsung/TizenRT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Samsung/TizenRT/merges","archive_url":"https://api.github.com/repos/Samsung/TizenRT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Samsung/TizenRT/downloads","issues_url":"https://api.github.com/repos/Samsung/TizenRT/issues{/number}","pulls_url":"https://api.github.com/repos/Samsung/TizenRT/pulls{/number}","milestones_url":"https://api.github.com/repos/Samsung/TizenRT/milestones{/number}","notifications_url":"https://api.github.com/repos/Samsung/TizenRT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Samsung/TizenRT/labels{/name}","releases_url":"https://api.github.com/repos/Samsung/TizenRT/releases{/id}","deployments_url":"https://api.github.com/repos/Samsung/TizenRT/deployments","created_at":"2017-02-20T04:38:30Z","updated_at":"2018-07-12T10:18:37Z","pushed_at":"2018-07-12T10:40:26Z","git_url":"git://github.com/Samsung/TizenRT.git","ssh_url":"git@github.com:Samsung/TizenRT.git","clone_url":"https://github.com/Samsung/TizenRT.git","svn_url":"https://github.com/Samsung/TizenRT","homepage":"","size":100549,"stargazers_count":182,"watchers_count":182,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":216,"mirror_url":null,"archived":false,"open_issues_count":46,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":216,"open_issues":46,"watchers":182,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Samsung/TizenRT/pulls/1925"},"html":{"href":"https://github.com/Samsung/TizenRT/pull/1925"},"issue":{"href":"https://api.github.com/repos/Samsung/TizenRT/issues/1925"},"comments":{"href":"https://api.github.com/repos/Samsung/TizenRT/issues/1925/comments"},"review_comments":{"href":"https://api.github.com/repos/Samsung/TizenRT/pulls/1925/comments"},"review_comment":{"href":"https://api.github.com/repos/Samsung/TizenRT/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Samsung/TizenRT/pulls/1925/commits"},"statuses":{"href":"https://api.github.com/repos/Samsung/TizenRT/statuses/7a1b6edc905a73046c61c5181b7e4c3e84ccd8bf"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Taejun-Kwon"}}