{"action":"created","comment":{"url":"https://api.github.com/repos/esl/MongooseIM/pulls/comments/170857611","pull_request_review_id":99606519,"id":170857611,"diff_hunk":"@@ -136,15 +140,24 @@ init([Socket, SockMod, Shaper, MaxStanzaSize]) ->\n %%                                      {stop, Reason, State}\n %% Description: Handling call messages\n %%--------------------------------------------------------------------\n-handle_call({starttls, TLSSocket}, _From, State) ->\n-    StateAfterReset = reset_parser(State),\n-    NewState = StateAfterReset#state{socket = TLSSocket,\n-                                 sock_mod = fast_tls},\n-    case fast_tls:recv_data(TLSSocket, <<\"\">>) of\n-        {ok, TLSData} ->\n-            {reply, ok, process_data(TLSData, NewState), ?HIBERNATE_TIMEOUT};\n-        {error, _Reason} ->\n-            {stop, normal, ok, NewState}\n+handle_call(get_socket, _From, #state{socket = Socket} = State) ->\n+    {reply, {ok, Socket}, State, ?HIBERNATE_TIMEOUT};\n+handle_call({starttls, TLSOpts}, From, #state{parser = Parser,\n+                                              socket = TCPSocket} = State) ->\n+    deactivate_socket(State),\n+    gen_server:reply(From,ok), %% let ejabberd_socket finish tcp negotiations\n+    case ejabberd_tls:tcp_to_tls(TCPSocket,TLSOpts) of\n+        {ok,TLSSocket} ->\n+            StateAfterReset = reset_parser(State),\n+            NewState = StateAfterReset#state{socket = TLSSocket,\n+                                             sock_mod = ejabberd_tls},\n+\t    case ejabberd_tls:recv_data(TLSSocket, <<\"\">>) of\n+                {ok, TLSData} ->\n+                    {noreply, process_data(TLSData, NewState), ?HIBERNATE_TIMEOUT};\n+                {error, _Reason} ->\n+                    {stop, normal, NewState}\n+            end;\n+        {error,_Reason} -> {stop, normal, State}","path":"src/ejabberd_receiver.erl","position":52,"original_position":52,"commit_id":"a350408e4beb934dd394b4afc251844d20f168a1","original_commit_id":"a350408e4beb934dd394b4afc251844d20f168a1","user":{"login":"fenek","id":548816,"avatar_url":"https://avatars0.githubusercontent.com/u/548816?v=4","gravatar_id":"","url":"https://api.github.com/users/fenek","html_url":"https://github.com/fenek","followers_url":"https://api.github.com/users/fenek/followers","following_url":"https://api.github.com/users/fenek/following{/other_user}","gists_url":"https://api.github.com/users/fenek/gists{/gist_id}","starred_url":"https://api.github.com/users/fenek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fenek/subscriptions","organizations_url":"https://api.github.com/users/fenek/orgs","repos_url":"https://api.github.com/users/fenek/repos","events_url":"https://api.github.com/users/fenek/events{/privacy}","received_events_url":"https://api.github.com/users/fenek/received_events","type":"User","site_admin":false},"body":"With `{stop, normal, State}` there won't be any meaningful error reported.","created_at":"2018-02-27T09:19:25Z","updated_at":"2018-02-27T09:19:25Z","html_url":"https://github.com/esl/MongooseIM/pull/1735#discussion_r170857611","pull_request_url":"https://api.github.com/repos/esl/MongooseIM/pulls/1735","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/esl/MongooseIM/pulls/comments/170857611"},"html":{"href":"https://github.com/esl/MongooseIM/pull/1735#discussion_r170857611"},"pull_request":{"href":"https://api.github.com/repos/esl/MongooseIM/pulls/1735"}},"in_reply_to_id":169777777},"pull_request":{"url":"https://api.github.com/repos/esl/MongooseIM/pulls/1735","id":169973965,"html_url":"https://github.com/esl/MongooseIM/pull/1735","diff_url":"https://github.com/esl/MongooseIM/pull/1735.diff","patch_url":"https://github.com/esl/MongooseIM/pull/1735.patch","issue_url":"https://api.github.com/repos/esl/MongooseIM/issues/1735","number":1735,"state":"open","locked":false,"title":"SASL EXTERNAL implementation","user":{"login":"DenysGonchar","id":23631268,"avatar_url":"https://avatars3.githubusercontent.com/u/23631268?v=4","gravatar_id":"","url":"https://api.github.com/users/DenysGonchar","html_url":"https://github.com/DenysGonchar","followers_url":"https://api.github.com/users/DenysGonchar/followers","following_url":"https://api.github.com/users/DenysGonchar/following{/other_user}","gists_url":"https://api.github.com/users/DenysGonchar/gists{/gist_id}","starred_url":"https://api.github.com/users/DenysGonchar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DenysGonchar/subscriptions","organizations_url":"https://api.github.com/users/DenysGonchar/orgs","repos_url":"https://api.github.com/users/DenysGonchar/repos","events_url":"https://api.github.com/users/DenysGonchar/events{/privacy}","received_events_url":"https://api.github.com/users/DenysGonchar/received_events","type":"User","site_admin":false},"body":"Initial implementation of SASL EXTERNAL\r\n\r\n","created_at":"2018-02-19T14:25:40Z","updated_at":"2018-02-27T09:19:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fbee69b71a19defb72eb81f4a0323f24374221f5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":166895362,"url":"https://api.github.com/repos/esl/MongooseIM/labels/WIP","name":"WIP","color":"bfe5bf","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/esl/MongooseIM/pulls/1735/commits","review_comments_url":"https://api.github.com/repos/esl/MongooseIM/pulls/1735/comments","review_comment_url":"https://api.github.com/repos/esl/MongooseIM/pulls/comments{/number}","comments_url":"https://api.github.com/repos/esl/MongooseIM/issues/1735/comments","statuses_url":"https://api.github.com/repos/esl/MongooseIM/statuses/a350408e4beb934dd394b4afc251844d20f168a1","head":{"label":"esl:SASL_EXTERNAL_implementation","ref":"SASL_EXTERNAL_implementation","sha":"a350408e4beb934dd394b4afc251844d20f168a1","user":{"login":"esl","id":283412,"avatar_url":"https://avatars3.githubusercontent.com/u/283412?v=4","gravatar_id":"","url":"https://api.github.com/users/esl","html_url":"https://github.com/esl","followers_url":"https://api.github.com/users/esl/followers","following_url":"https://api.github.com/users/esl/following{/other_user}","gists_url":"https://api.github.com/users/esl/gists{/gist_id}","starred_url":"https://api.github.com/users/esl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esl/subscriptions","organizations_url":"https://api.github.com/users/esl/orgs","repos_url":"https://api.github.com/users/esl/repos","events_url":"https://api.github.com/users/esl/events{/privacy}","received_events_url":"https://api.github.com/users/esl/received_events","type":"Organization","site_admin":false},"repo":{"id":2354240,"name":"MongooseIM","full_name":"esl/MongooseIM","owner":{"login":"esl","id":283412,"avatar_url":"https://avatars3.githubusercontent.com/u/283412?v=4","gravatar_id":"","url":"https://api.github.com/users/esl","html_url":"https://github.com/esl","followers_url":"https://api.github.com/users/esl/followers","following_url":"https://api.github.com/users/esl/following{/other_user}","gists_url":"https://api.github.com/users/esl/gists{/gist_id}","starred_url":"https://api.github.com/users/esl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esl/subscriptions","organizations_url":"https://api.github.com/users/esl/orgs","repos_url":"https://api.github.com/users/esl/repos","events_url":"https://api.github.com/users/esl/events{/privacy}","received_events_url":"https://api.github.com/users/esl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/esl/MongooseIM","description":"MongooseIM is a mobile messaging platform with focus on performance and scalability","fork":false,"url":"https://api.github.com/repos/esl/MongooseIM","forks_url":"https://api.github.com/repos/esl/MongooseIM/forks","keys_url":"https://api.github.com/repos/esl/MongooseIM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/esl/MongooseIM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/esl/MongooseIM/teams","hooks_url":"https://api.github.com/repos/esl/MongooseIM/hooks","issue_events_url":"https://api.github.com/repos/esl/MongooseIM/issues/events{/number}","events_url":"https://api.github.com/repos/esl/MongooseIM/events","assignees_url":"https://api.github.com/repos/esl/MongooseIM/assignees{/user}","branches_url":"https://api.github.com/repos/esl/MongooseIM/branches{/branch}","tags_url":"https://api.github.com/repos/esl/MongooseIM/tags","blobs_url":"https://api.github.com/repos/esl/MongooseIM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/esl/MongooseIM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/esl/MongooseIM/git/refs{/sha}","trees_url":"https://api.github.com/repos/esl/MongooseIM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/esl/MongooseIM/statuses/{sha}","languages_url":"https://api.github.com/repos/esl/MongooseIM/languages","stargazers_url":"https://api.github.com/repos/esl/MongooseIM/stargazers","contributors_url":"https://api.github.com/repos/esl/MongooseIM/contributors","subscribers_url":"https://api.github.com/repos/esl/MongooseIM/subscribers","subscription_url":"https://api.github.com/repos/esl/MongooseIM/subscription","commits_url":"https://api.github.com/repos/esl/MongooseIM/commits{/sha}","git_commits_url":"https://api.github.com/repos/esl/MongooseIM/git/commits{/sha}","comments_url":"https://api.github.com/repos/esl/MongooseIM/comments{/number}","issue_comment_url":"https://api.github.com/repos/esl/MongooseIM/issues/comments{/number}","contents_url":"https://api.github.com/repos/esl/MongooseIM/contents/{+path}","compare_url":"https://api.github.com/repos/esl/MongooseIM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/esl/MongooseIM/merges","archive_url":"https://api.github.com/repos/esl/MongooseIM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/esl/MongooseIM/downloads","issues_url":"https://api.github.com/repos/esl/MongooseIM/issues{/number}","pulls_url":"https://api.github.com/repos/esl/MongooseIM/pulls{/number}","milestones_url":"https://api.github.com/repos/esl/MongooseIM/milestones{/number}","notifications_url":"https://api.github.com/repos/esl/MongooseIM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/esl/MongooseIM/labels{/name}","releases_url":"https://api.github.com/repos/esl/MongooseIM/releases{/id}","deployments_url":"https://api.github.com/repos/esl/MongooseIM/deployments","created_at":"2011-09-09T08:19:18Z","updated_at":"2018-02-26T14:27:48Z","pushed_at":"2018-02-26T17:18:42Z","git_url":"git://github.com/esl/MongooseIM.git","ssh_url":"git@github.com:esl/MongooseIM.git","clone_url":"https://github.com/esl/MongooseIM.git","svn_url":"https://github.com/esl/MongooseIM","homepage":"","size":29697,"stargazers_count":872,"watchers_count":872,"language":"Erlang","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":304,"mirror_url":null,"archived":false,"open_issues_count":139,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":304,"open_issues":139,"watchers":872,"default_branch":"master"}},"base":{"label":"esl:master","ref":"master","sha":"4666716cb46dcc15a41c92e9e115eaa6d7b96164","user":{"login":"esl","id":283412,"avatar_url":"https://avatars3.githubusercontent.com/u/283412?v=4","gravatar_id":"","url":"https://api.github.com/users/esl","html_url":"https://github.com/esl","followers_url":"https://api.github.com/users/esl/followers","following_url":"https://api.github.com/users/esl/following{/other_user}","gists_url":"https://api.github.com/users/esl/gists{/gist_id}","starred_url":"https://api.github.com/users/esl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esl/subscriptions","organizations_url":"https://api.github.com/users/esl/orgs","repos_url":"https://api.github.com/users/esl/repos","events_url":"https://api.github.com/users/esl/events{/privacy}","received_events_url":"https://api.github.com/users/esl/received_events","type":"Organization","site_admin":false},"repo":{"id":2354240,"name":"MongooseIM","full_name":"esl/MongooseIM","owner":{"login":"esl","id":283412,"avatar_url":"https://avatars3.githubusercontent.com/u/283412?v=4","gravatar_id":"","url":"https://api.github.com/users/esl","html_url":"https://github.com/esl","followers_url":"https://api.github.com/users/esl/followers","following_url":"https://api.github.com/users/esl/following{/other_user}","gists_url":"https://api.github.com/users/esl/gists{/gist_id}","starred_url":"https://api.github.com/users/esl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/esl/subscriptions","organizations_url":"https://api.github.com/users/esl/orgs","repos_url":"https://api.github.com/users/esl/repos","events_url":"https://api.github.com/users/esl/events{/privacy}","received_events_url":"https://api.github.com/users/esl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/esl/MongooseIM","description":"MongooseIM is a mobile messaging platform with focus on performance and scalability","fork":false,"url":"https://api.github.com/repos/esl/MongooseIM","forks_url":"https://api.github.com/repos/esl/MongooseIM/forks","keys_url":"https://api.github.com/repos/esl/MongooseIM/keys{/key_id}","collaborators_url":"https://api.github.com/repos/esl/MongooseIM/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/esl/MongooseIM/teams","hooks_url":"https://api.github.com/repos/esl/MongooseIM/hooks","issue_events_url":"https://api.github.com/repos/esl/MongooseIM/issues/events{/number}","events_url":"https://api.github.com/repos/esl/MongooseIM/events","assignees_url":"https://api.github.com/repos/esl/MongooseIM/assignees{/user}","branches_url":"https://api.github.com/repos/esl/MongooseIM/branches{/branch}","tags_url":"https://api.github.com/repos/esl/MongooseIM/tags","blobs_url":"https://api.github.com/repos/esl/MongooseIM/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/esl/MongooseIM/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/esl/MongooseIM/git/refs{/sha}","trees_url":"https://api.github.com/repos/esl/MongooseIM/git/trees{/sha}","statuses_url":"https://api.github.com/repos/esl/MongooseIM/statuses/{sha}","languages_url":"https://api.github.com/repos/esl/MongooseIM/languages","stargazers_url":"https://api.github.com/repos/esl/MongooseIM/stargazers","contributors_url":"https://api.github.com/repos/esl/MongooseIM/contributors","subscribers_url":"https://api.github.com/repos/esl/MongooseIM/subscribers","subscription_url":"https://api.github.com/repos/esl/MongooseIM/subscription","commits_url":"https://api.github.com/repos/esl/MongooseIM/commits{/sha}","git_commits_url":"https://api.github.com/repos/esl/MongooseIM/git/commits{/sha}","comments_url":"https://api.github.com/repos/esl/MongooseIM/comments{/number}","issue_comment_url":"https://api.github.com/repos/esl/MongooseIM/issues/comments{/number}","contents_url":"https://api.github.com/repos/esl/MongooseIM/contents/{+path}","compare_url":"https://api.github.com/repos/esl/MongooseIM/compare/{base}...{head}","merges_url":"https://api.github.com/repos/esl/MongooseIM/merges","archive_url":"https://api.github.com/repos/esl/MongooseIM/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/esl/MongooseIM/downloads","issues_url":"https://api.github.com/repos/esl/MongooseIM/issues{/number}","pulls_url":"https://api.github.com/repos/esl/MongooseIM/pulls{/number}","milestones_url":"https://api.github.com/repos/esl/MongooseIM/milestones{/number}","notifications_url":"https://api.github.com/repos/esl/MongooseIM/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/esl/MongooseIM/labels{/name}","releases_url":"https://api.github.com/repos/esl/MongooseIM/releases{/id}","deployments_url":"https://api.github.com/repos/esl/MongooseIM/deployments","created_at":"2011-09-09T08:19:18Z","updated_at":"2018-02-26T14:27:48Z","pushed_at":"2018-02-26T17:18:42Z","git_url":"git://github.com/esl/MongooseIM.git","ssh_url":"git@github.com:esl/MongooseIM.git","clone_url":"https://github.com/esl/MongooseIM.git","svn_url":"https://github.com/esl/MongooseIM","homepage":"","size":29697,"stargazers_count":872,"watchers_count":872,"language":"Erlang","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":304,"mirror_url":null,"archived":false,"open_issues_count":139,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":304,"open_issues":139,"watchers":872,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/esl/MongooseIM/pulls/1735"},"html":{"href":"https://github.com/esl/MongooseIM/pull/1735"},"issue":{"href":"https://api.github.com/repos/esl/MongooseIM/issues/1735"},"comments":{"href":"https://api.github.com/repos/esl/MongooseIM/issues/1735/comments"},"review_comments":{"href":"https://api.github.com/repos/esl/MongooseIM/pulls/1735/comments"},"review_comment":{"href":"https://api.github.com/repos/esl/MongooseIM/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/esl/MongooseIM/pulls/1735/commits"},"statuses":{"href":"https://api.github.com/repos/esl/MongooseIM/statuses/a350408e4beb934dd394b4afc251844d20f168a1"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"fenek"}}