{"action":"created","comment":{"url":"https://api.github.com/repos/kaaproject/kaa/pulls/comments/68893185","id":68893185,"diff_hunk":"@@ -1120,39 +1153,44 @@ kaa_error_t kaa_tcp_channel_authorize(kaa_tcp_channel_t *self)\n             &sync_buffer,\n             &sync_size);\n \n-    KAA_LOG_TRACE(self->logger, error_code, \"Kaa TCP channel [0x%08X] going to send CONNECT message (%zu bytes)\"\n-                                                                                , self->access_point.id, sync_size);\n+#ifdef KAA_ENCRYPTION\n+    /* TODO: Rework the solution to cipher without additional allocations */\n+    error_code = kaa_tcp_channel_encrypt(self, (char **)&sync_buffer, &sync_size);\n+    if (error_code) {\n+        KAA_FREE(sync_buffer);\n+        return error_code;\n+    }\n+#endif\n \n-    kaa_error_t delete_error_code = kaa_tcp_channel_delete_pending_services(self\n-                                                       , self->pending_request_services\n-                                                       , self->pending_request_service_count);\n+    KAA_LOG_TRACE(self->logger, error_code, \"Kaa TCP channel [0x%08X] going to send CONNECT message (%zu bytes)\",\n+                  self->access_point.id, sync_size);\n+\n+    kaa_error_t delete_error_code = kaa_tcp_channel_delete_pending_services(self, self->pending_request_services,\n+                                                                            self->pending_request_service_count);\n     if (delete_error_code) {\n-        KAA_LOG_ERROR(self->logger, delete_error_code, \"Kaa TCP channel [0x%08X] failed to delete pending services\"\n-                                                                                , self->access_point.id);\n+        KAA_LOG_ERROR(self->logger, delete_error_code, \"Kaa TCP channel [0x%08X] failed to delete pending services\",\n+                      self->access_point.id);\n     }\n \n     if (error_code || delete_error_code) {\n         if (!error_code && delete_error_code)\n             error_code = delete_error_code;\n \n         KAA_LOG_ERROR(self->logger, error_code, \"Kaa TCP channel [0x%08X] failed to serialize supported services\",","path":"client/client-multi/client-c/src/kaa/platform-impl/common/kaa_tcp_channel.c","position":476,"original_position":476,"commit_id":"1f7252789ffb8882e75f93d4228728d2c609b856","original_commit_id":"1f7252789ffb8882e75f93d4228728d2c609b856","user":{"login":"RostakaGmfun","id":5872727,"avatar_url":"https://avatars.githubusercontent.com/u/5872727?v=3","gravatar_id":"","url":"https://api.github.com/users/RostakaGmfun","html_url":"https://github.com/RostakaGmfun","followers_url":"https://api.github.com/users/RostakaGmfun/followers","following_url":"https://api.github.com/users/RostakaGmfun/following{/other_user}","gists_url":"https://api.github.com/users/RostakaGmfun/gists{/gist_id}","starred_url":"https://api.github.com/users/RostakaGmfun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RostakaGmfun/subscriptions","organizations_url":"https://api.github.com/users/RostakaGmfun/orgs","repos_url":"https://api.github.com/users/RostakaGmfun/repos","events_url":"https://api.github.com/users/RostakaGmfun/events{/privacy}","received_events_url":"https://api.github.com/users/RostakaGmfun/received_events","type":"User","site_admin":false},"body":"```c\r\nif (sync_buffer) {\r\n    KAA_FREE(sync_buffer);\r\n}\r\nkaa_error_t delete_error_code = ...;\r\nif (delete_error_code) {\r\n    KAA_LOG_ERROR(..., delete_error_code, ...);\r\n}\r\nif (error_code) {\r\n    KAA_LOG_ERROR(..., error_code, ...);\r\n}\r\n\r\nreturn error_code ? error_code : delete_error_code;\r\n```","created_at":"2016-06-29T06:43:48Z","updated_at":"2016-06-29T06:43:48Z","html_url":"https://github.com/kaaproject/kaa/pull/809#discussion_r68893185","pull_request_url":"https://api.github.com/repos/kaaproject/kaa/pulls/809","_links":{"self":{"href":"https://api.github.com/repos/kaaproject/kaa/pulls/comments/68893185"},"html":{"href":"https://github.com/kaaproject/kaa/pull/809#discussion_r68893185"},"pull_request":{"href":"https://api.github.com/repos/kaaproject/kaa/pulls/809"}}},"pull_request":{"url":"https://api.github.com/repos/kaaproject/kaa/pulls/809","id":75560577,"html_url":"https://github.com/kaaproject/kaa/pull/809","diff_url":"https://github.com/kaaproject/kaa/pull/809.diff","patch_url":"https://github.com/kaaproject/kaa/pull/809.patch","issue_url":"https://api.github.com/repos/kaaproject/kaa/issues/809","number":809,"state":"open","locked":false,"title":"KAA-635 Introduce encryption","user":{"login":"GamovCoder","id":9300235,"avatar_url":"https://avatars.githubusercontent.com/u/9300235?v=3","gravatar_id":"","url":"https://api.github.com/users/GamovCoder","html_url":"https://github.com/GamovCoder","followers_url":"https://api.github.com/users/GamovCoder/followers","following_url":"https://api.github.com/users/GamovCoder/following{/other_user}","gists_url":"https://api.github.com/users/GamovCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/GamovCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GamovCoder/subscriptions","organizations_url":"https://api.github.com/users/GamovCoder/orgs","repos_url":"https://api.github.com/users/GamovCoder/repos","events_url":"https://api.github.com/users/GamovCoder/events{/privacy}","received_events_url":"https://api.github.com/users/GamovCoder/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-06-28T22:22:54Z","updated_at":"2016-06-29T06:43:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f3a3059c63e1402d22dc25cde0c2d9f1aa379b3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kaaproject/kaa/pulls/809/commits","review_comments_url":"https://api.github.com/repos/kaaproject/kaa/pulls/809/comments","review_comment_url":"https://api.github.com/repos/kaaproject/kaa/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kaaproject/kaa/issues/809/comments","statuses_url":"https://api.github.com/repos/kaaproject/kaa/statuses/1f7252789ffb8882e75f93d4228728d2c609b856","head":{"label":"GamovCoder:KAA-635","ref":"KAA-635","sha":"1f7252789ffb8882e75f93d4228728d2c609b856","user":{"login":"GamovCoder","id":9300235,"avatar_url":"https://avatars.githubusercontent.com/u/9300235?v=3","gravatar_id":"","url":"https://api.github.com/users/GamovCoder","html_url":"https://github.com/GamovCoder","followers_url":"https://api.github.com/users/GamovCoder/followers","following_url":"https://api.github.com/users/GamovCoder/following{/other_user}","gists_url":"https://api.github.com/users/GamovCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/GamovCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GamovCoder/subscriptions","organizations_url":"https://api.github.com/users/GamovCoder/orgs","repos_url":"https://api.github.com/users/GamovCoder/repos","events_url":"https://api.github.com/users/GamovCoder/events{/privacy}","received_events_url":"https://api.github.com/users/GamovCoder/received_events","type":"User","site_admin":false},"repo":{"id":55521828,"name":"kaa","full_name":"GamovCoder/kaa","owner":{"login":"GamovCoder","id":9300235,"avatar_url":"https://avatars.githubusercontent.com/u/9300235?v=3","gravatar_id":"","url":"https://api.github.com/users/GamovCoder","html_url":"https://github.com/GamovCoder","followers_url":"https://api.github.com/users/GamovCoder/followers","following_url":"https://api.github.com/users/GamovCoder/following{/other_user}","gists_url":"https://api.github.com/users/GamovCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/GamovCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GamovCoder/subscriptions","organizations_url":"https://api.github.com/users/GamovCoder/orgs","repos_url":"https://api.github.com/users/GamovCoder/repos","events_url":"https://api.github.com/users/GamovCoder/events{/privacy}","received_events_url":"https://api.github.com/users/GamovCoder/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/GamovCoder/kaa","description":"Kaa open-source middleware platform for building, managing, and integrating connected products with the Internet of Everything.","fork":true,"url":"https://api.github.com/repos/GamovCoder/kaa","forks_url":"https://api.github.com/repos/GamovCoder/kaa/forks","keys_url":"https://api.github.com/repos/GamovCoder/kaa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GamovCoder/kaa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GamovCoder/kaa/teams","hooks_url":"https://api.github.com/repos/GamovCoder/kaa/hooks","issue_events_url":"https://api.github.com/repos/GamovCoder/kaa/issues/events{/number}","events_url":"https://api.github.com/repos/GamovCoder/kaa/events","assignees_url":"https://api.github.com/repos/GamovCoder/kaa/assignees{/user}","branches_url":"https://api.github.com/repos/GamovCoder/kaa/branches{/branch}","tags_url":"https://api.github.com/repos/GamovCoder/kaa/tags","blobs_url":"https://api.github.com/repos/GamovCoder/kaa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GamovCoder/kaa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GamovCoder/kaa/git/refs{/sha}","trees_url":"https://api.github.com/repos/GamovCoder/kaa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GamovCoder/kaa/statuses/{sha}","languages_url":"https://api.github.com/repos/GamovCoder/kaa/languages","stargazers_url":"https://api.github.com/repos/GamovCoder/kaa/stargazers","contributors_url":"https://api.github.com/repos/GamovCoder/kaa/contributors","subscribers_url":"https://api.github.com/repos/GamovCoder/kaa/subscribers","subscription_url":"https://api.github.com/repos/GamovCoder/kaa/subscription","commits_url":"https://api.github.com/repos/GamovCoder/kaa/commits{/sha}","git_commits_url":"https://api.github.com/repos/GamovCoder/kaa/git/commits{/sha}","comments_url":"https://api.github.com/repos/GamovCoder/kaa/comments{/number}","issue_comment_url":"https://api.github.com/repos/GamovCoder/kaa/issues/comments{/number}","contents_url":"https://api.github.com/repos/GamovCoder/kaa/contents/{+path}","compare_url":"https://api.github.com/repos/GamovCoder/kaa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GamovCoder/kaa/merges","archive_url":"https://api.github.com/repos/GamovCoder/kaa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GamovCoder/kaa/downloads","issues_url":"https://api.github.com/repos/GamovCoder/kaa/issues{/number}","pulls_url":"https://api.github.com/repos/GamovCoder/kaa/pulls{/number}","milestones_url":"https://api.github.com/repos/GamovCoder/kaa/milestones{/number}","notifications_url":"https://api.github.com/repos/GamovCoder/kaa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GamovCoder/kaa/labels{/name}","releases_url":"https://api.github.com/repos/GamovCoder/kaa/releases{/id}","deployments_url":"https://api.github.com/repos/GamovCoder/kaa/deployments","created_at":"2016-04-05T15:58:07Z","updated_at":"2016-04-05T15:58:16Z","pushed_at":"2016-06-28T23:02:17Z","git_url":"git://github.com/GamovCoder/kaa.git","ssh_url":"git@github.com:GamovCoder/kaa.git","clone_url":"https://github.com/GamovCoder/kaa.git","svn_url":"https://github.com/GamovCoder/kaa","homepage":"http://www.kaaproject.org","size":89367,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kaaproject:develop","ref":"develop","sha":"11bc99383148ff9809eb9654eb610d3eea23019d","user":{"login":"kaaproject","id":6984613,"avatar_url":"https://avatars.githubusercontent.com/u/6984613?v=3","gravatar_id":"","url":"https://api.github.com/users/kaaproject","html_url":"https://github.com/kaaproject","followers_url":"https://api.github.com/users/kaaproject/followers","following_url":"https://api.github.com/users/kaaproject/following{/other_user}","gists_url":"https://api.github.com/users/kaaproject/gists{/gist_id}","starred_url":"https://api.github.com/users/kaaproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaaproject/subscriptions","organizations_url":"https://api.github.com/users/kaaproject/orgs","repos_url":"https://api.github.com/users/kaaproject/repos","events_url":"https://api.github.com/users/kaaproject/events{/privacy}","received_events_url":"https://api.github.com/users/kaaproject/received_events","type":"Organization","site_admin":false},"repo":{"id":17839346,"name":"kaa","full_name":"kaaproject/kaa","owner":{"login":"kaaproject","id":6984613,"avatar_url":"https://avatars.githubusercontent.com/u/6984613?v=3","gravatar_id":"","url":"https://api.github.com/users/kaaproject","html_url":"https://github.com/kaaproject","followers_url":"https://api.github.com/users/kaaproject/followers","following_url":"https://api.github.com/users/kaaproject/following{/other_user}","gists_url":"https://api.github.com/users/kaaproject/gists{/gist_id}","starred_url":"https://api.github.com/users/kaaproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaaproject/subscriptions","organizations_url":"https://api.github.com/users/kaaproject/orgs","repos_url":"https://api.github.com/users/kaaproject/repos","events_url":"https://api.github.com/users/kaaproject/events{/privacy}","received_events_url":"https://api.github.com/users/kaaproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kaaproject/kaa","description":"Kaa open-source middleware platform for building, managing, and integrating connected products with the Internet of Everything.","fork":false,"url":"https://api.github.com/repos/kaaproject/kaa","forks_url":"https://api.github.com/repos/kaaproject/kaa/forks","keys_url":"https://api.github.com/repos/kaaproject/kaa/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaaproject/kaa/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaaproject/kaa/teams","hooks_url":"https://api.github.com/repos/kaaproject/kaa/hooks","issue_events_url":"https://api.github.com/repos/kaaproject/kaa/issues/events{/number}","events_url":"https://api.github.com/repos/kaaproject/kaa/events","assignees_url":"https://api.github.com/repos/kaaproject/kaa/assignees{/user}","branches_url":"https://api.github.com/repos/kaaproject/kaa/branches{/branch}","tags_url":"https://api.github.com/repos/kaaproject/kaa/tags","blobs_url":"https://api.github.com/repos/kaaproject/kaa/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaaproject/kaa/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaaproject/kaa/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaaproject/kaa/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaaproject/kaa/statuses/{sha}","languages_url":"https://api.github.com/repos/kaaproject/kaa/languages","stargazers_url":"https://api.github.com/repos/kaaproject/kaa/stargazers","contributors_url":"https://api.github.com/repos/kaaproject/kaa/contributors","subscribers_url":"https://api.github.com/repos/kaaproject/kaa/subscribers","subscription_url":"https://api.github.com/repos/kaaproject/kaa/subscription","commits_url":"https://api.github.com/repos/kaaproject/kaa/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaaproject/kaa/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaaproject/kaa/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaaproject/kaa/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaaproject/kaa/contents/{+path}","compare_url":"https://api.github.com/repos/kaaproject/kaa/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaaproject/kaa/merges","archive_url":"https://api.github.com/repos/kaaproject/kaa/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaaproject/kaa/downloads","issues_url":"https://api.github.com/repos/kaaproject/kaa/issues{/number}","pulls_url":"https://api.github.com/repos/kaaproject/kaa/pulls{/number}","milestones_url":"https://api.github.com/repos/kaaproject/kaa/milestones{/number}","notifications_url":"https://api.github.com/repos/kaaproject/kaa/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaaproject/kaa/labels{/name}","releases_url":"https://api.github.com/repos/kaaproject/kaa/releases{/id}","deployments_url":"https://api.github.com/repos/kaaproject/kaa/deployments","created_at":"2014-03-17T18:48:31Z","updated_at":"2016-06-29T04:05:59Z","pushed_at":"2016-06-28T23:02:18Z","git_url":"git://github.com/kaaproject/kaa.git","ssh_url":"git@github.com:kaaproject/kaa.git","clone_url":"https://github.com/kaaproject/kaa.git","svn_url":"https://github.com/kaaproject/kaa","homepage":"http://www.kaaproject.org","size":144764,"stargazers_count":306,"watchers_count":306,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":119,"mirror_url":null,"open_issues_count":17,"forks":119,"open_issues":17,"watchers":306,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kaaproject/kaa/pulls/809"},"html":{"href":"https://github.com/kaaproject/kaa/pull/809"},"issue":{"href":"https://api.github.com/repos/kaaproject/kaa/issues/809"},"comments":{"href":"https://api.github.com/repos/kaaproject/kaa/issues/809/comments"},"review_comments":{"href":"https://api.github.com/repos/kaaproject/kaa/pulls/809/comments"},"review_comment":{"href":"https://api.github.com/repos/kaaproject/kaa/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kaaproject/kaa/pulls/809/commits"},"statuses":{"href":"https://api.github.com/repos/kaaproject/kaa/statuses/1f7252789ffb8882e75f93d4228728d2c609b856"}}}}
{"actor":{"display_login":"RostakaGmfun"}}