{"action":"created","comment":{"url":"https://api.github.com/repos/sfackler/rust-openssl/pulls/comments/73790145","id":73790145,"diff_hunk":"@@ -1223,6 +1227,44 @@ impl<S> MidHandshakeSslStream<S> {\n         &self.error\n     }\n \n+    /// Gets the next DTLS handshake timeout.\n+    ///\n+    /// This is intended to be used with a nonblocking socket, where the value\n+    /// can be used to set timeouts on reading and performing handshakes.\n+    ///\n+    /// `handle_dtlsv1_timeout` should be called when the timeout expires to\n+    /// ask OpenSSL to retransmit.\n+    ///\n+    /// This method requires either the `dtlsv1` or `dtlsv1_2` feature.\n+    #[cfg(any(feature = \"dtlsv1\", feature = \"dtlsv1_2\"))]\n+    pub fn get_dtlsv1_timeout(&mut self) -> Option<time::Duration> {\n+        let mut timeout: timeval = unsafe { mem::zeroed() };\n+        let ret = unsafe { ffi::SSL_ctrl(self.stream.ssl.ssl, ffi::DTLS_CTRL_GET_TIMEOUT, 0,\n+                                         &mut timeout as *mut _ as *mut _) };\n+        if ret > 0 {\n+            Some(time::Duration::new(timeout.tv_sec as u64, (timeout.tv_usec * 1000) as u32))\n+        } else {\n+            None\n+        }\n+    }\n+\n+    /// Handles DTLS handshake timeout expiry.\n+    ///\n+    /// This should be called when the timeout from `get_dtlsv1_timeout`\n+    /// expires, to retransmit the handshake.\n+    ///\n+    /// This method requires either the `dtlsv1` or `dtlsv1_2` feature.\n+    #[cfg(any(feature = \"dtlsv1\", feature = \"dtlsv1_2\"))]\n+    pub fn handle_dtlsv1_timeout(&mut self) -> Result<(), Error> {\n+        let ret = unsafe { ffi::SSL_ctrl(self.stream.ssl.ssl, ffi::DTLS_CTRL_HANDLE_TIMEOUT, 0,\n+                                         ptr::null_mut()) };\n+        if ret > 0 {\n+            Ok(())\n+        } else {\n+            Err(self.stream.make_error(ret as i32))","path":"openssl/src/ssl/mod.rs","position":null,"original_position":49,"commit_id":"c036de7c3e4079bc605d26c51a9f02d0018d2bc1","original_commit_id":"2c7c988d3e86998bebc1b22067fb3073229e2db0","user":{"login":"rfw","id":56240,"avatar_url":"https://avatars.githubusercontent.com/u/56240?v=3","gravatar_id":"","url":"https://api.github.com/users/rfw","html_url":"https://github.com/rfw","followers_url":"https://api.github.com/users/rfw/followers","following_url":"https://api.github.com/users/rfw/following{/other_user}","gists_url":"https://api.github.com/users/rfw/gists{/gist_id}","starred_url":"https://api.github.com/users/rfw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rfw/subscriptions","organizations_url":"https://api.github.com/users/rfw/orgs","repos_url":"https://api.github.com/users/rfw/repos","events_url":"https://api.github.com/users/rfw/events{/privacy}","received_events_url":"https://api.github.com/users/rfw/received_events","type":"User","site_admin":false},"body":"... but I guess the above doesn't matter if I'm using wrap_ssl_result :)","created_at":"2016-08-06T18:49:52Z","updated_at":"2016-08-06T18:49:52Z","html_url":"https://github.com/sfackler/rust-openssl/pull/437#discussion_r73790145","pull_request_url":"https://api.github.com/repos/sfackler/rust-openssl/pulls/437","_links":{"self":{"href":"https://api.github.com/repos/sfackler/rust-openssl/pulls/comments/73790145"},"html":{"href":"https://github.com/sfackler/rust-openssl/pull/437#discussion_r73790145"},"pull_request":{"href":"https://api.github.com/repos/sfackler/rust-openssl/pulls/437"}}},"pull_request":{"url":"https://api.github.com/repos/sfackler/rust-openssl/pulls/437","id":80174707,"html_url":"https://github.com/sfackler/rust-openssl/pull/437","diff_url":"https://github.com/sfackler/rust-openssl/pull/437.diff","patch_url":"https://github.com/sfackler/rust-openssl/pull/437.patch","issue_url":"https://api.github.com/repos/sfackler/rust-openssl/issues/437","number":437,"state":"open","locked":false,"title":"Add more support for non-blocking DTLS sockets.","user":{"login":"rfw","id":56240,"avatar_url":"https://avatars.githubusercontent.com/u/56240?v=3","gravatar_id":"","url":"https://api.github.com/users/rfw","html_url":"https://github.com/rfw","followers_url":"https://api.github.com/users/rfw/followers","following_url":"https://api.github.com/users/rfw/following{/other_user}","gists_url":"https://api.github.com/users/rfw/gists{/gist_id}","starred_url":"https://api.github.com/users/rfw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rfw/subscriptions","organizations_url":"https://api.github.com/users/rfw/orgs","repos_url":"https://api.github.com/users/rfw/repos","events_url":"https://api.github.com/users/rfw/events{/privacy}","received_events_url":"https://api.github.com/users/rfw/received_events","type":"User","site_admin":false},"body":"This introduces two new methods on MidHandshakeSslStream:\r\n\r\n- get_dtlsv1_timeout: Gets the next DTLS handshake timeout.\r\n- handle_dtlsv1_timeout: Handles DTLS handshake timeout expiry.\r\n\r\nThis is against the breaks branch which contains MidHandshakeSslStream.","created_at":"2016-08-05T01:12:55Z","updated_at":"2016-08-06T18:49:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98840eda964b10de79bae11d65812e478d61b8a0","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sfackler/rust-openssl/pulls/437/commits","review_comments_url":"https://api.github.com/repos/sfackler/rust-openssl/pulls/437/comments","review_comment_url":"https://api.github.com/repos/sfackler/rust-openssl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sfackler/rust-openssl/issues/437/comments","statuses_url":"https://api.github.com/repos/sfackler/rust-openssl/statuses/c036de7c3e4079bc605d26c51a9f02d0018d2bc1","head":{"label":"rfw:patch-1","ref":"patch-1","sha":"c036de7c3e4079bc605d26c51a9f02d0018d2bc1","user":{"login":"rfw","id":56240,"avatar_url":"https://avatars.githubusercontent.com/u/56240?v=3","gravatar_id":"","url":"https://api.github.com/users/rfw","html_url":"https://github.com/rfw","followers_url":"https://api.github.com/users/rfw/followers","following_url":"https://api.github.com/users/rfw/following{/other_user}","gists_url":"https://api.github.com/users/rfw/gists{/gist_id}","starred_url":"https://api.github.com/users/rfw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rfw/subscriptions","organizations_url":"https://api.github.com/users/rfw/orgs","repos_url":"https://api.github.com/users/rfw/repos","events_url":"https://api.github.com/users/rfw/events{/privacy}","received_events_url":"https://api.github.com/users/rfw/received_events","type":"User","site_admin":false},"repo":{"id":64439095,"name":"rust-openssl","full_name":"rfw/rust-openssl","owner":{"login":"rfw","id":56240,"avatar_url":"https://avatars.githubusercontent.com/u/56240?v=3","gravatar_id":"","url":"https://api.github.com/users/rfw","html_url":"https://github.com/rfw","followers_url":"https://api.github.com/users/rfw/followers","following_url":"https://api.github.com/users/rfw/following{/other_user}","gists_url":"https://api.github.com/users/rfw/gists{/gist_id}","starred_url":"https://api.github.com/users/rfw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rfw/subscriptions","organizations_url":"https://api.github.com/users/rfw/orgs","repos_url":"https://api.github.com/users/rfw/repos","events_url":"https://api.github.com/users/rfw/events{/privacy}","received_events_url":"https://api.github.com/users/rfw/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rfw/rust-openssl","description":"OpenSSL bindings for Rust","fork":true,"url":"https://api.github.com/repos/rfw/rust-openssl","forks_url":"https://api.github.com/repos/rfw/rust-openssl/forks","keys_url":"https://api.github.com/repos/rfw/rust-openssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rfw/rust-openssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rfw/rust-openssl/teams","hooks_url":"https://api.github.com/repos/rfw/rust-openssl/hooks","issue_events_url":"https://api.github.com/repos/rfw/rust-openssl/issues/events{/number}","events_url":"https://api.github.com/repos/rfw/rust-openssl/events","assignees_url":"https://api.github.com/repos/rfw/rust-openssl/assignees{/user}","branches_url":"https://api.github.com/repos/rfw/rust-openssl/branches{/branch}","tags_url":"https://api.github.com/repos/rfw/rust-openssl/tags","blobs_url":"https://api.github.com/repos/rfw/rust-openssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rfw/rust-openssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rfw/rust-openssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/rfw/rust-openssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rfw/rust-openssl/statuses/{sha}","languages_url":"https://api.github.com/repos/rfw/rust-openssl/languages","stargazers_url":"https://api.github.com/repos/rfw/rust-openssl/stargazers","contributors_url":"https://api.github.com/repos/rfw/rust-openssl/contributors","subscribers_url":"https://api.github.com/repos/rfw/rust-openssl/subscribers","subscription_url":"https://api.github.com/repos/rfw/rust-openssl/subscription","commits_url":"https://api.github.com/repos/rfw/rust-openssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/rfw/rust-openssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/rfw/rust-openssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/rfw/rust-openssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/rfw/rust-openssl/contents/{+path}","compare_url":"https://api.github.com/repos/rfw/rust-openssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rfw/rust-openssl/merges","archive_url":"https://api.github.com/repos/rfw/rust-openssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rfw/rust-openssl/downloads","issues_url":"https://api.github.com/repos/rfw/rust-openssl/issues{/number}","pulls_url":"https://api.github.com/repos/rfw/rust-openssl/pulls{/number}","milestones_url":"https://api.github.com/repos/rfw/rust-openssl/milestones{/number}","notifications_url":"https://api.github.com/repos/rfw/rust-openssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rfw/rust-openssl/labels{/name}","releases_url":"https://api.github.com/repos/rfw/rust-openssl/releases{/id}","deployments_url":"https://api.github.com/repos/rfw/rust-openssl/deployments","created_at":"2016-07-29T01:08:08Z","updated_at":"2016-07-29T01:08:09Z","pushed_at":"2016-08-06T18:48:49Z","git_url":"git://github.com/rfw/rust-openssl.git","ssh_url":"git@github.com:rfw/rust-openssl.git","clone_url":"https://github.com/rfw/rust-openssl.git","svn_url":"https://github.com/rfw/rust-openssl","homepage":"","size":10776,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"sfackler:breaks","ref":"breaks","sha":"08e27f31ed851873f7684ac806b837e8cff4a28f","user":{"login":"sfackler","id":1455697,"avatar_url":"https://avatars.githubusercontent.com/u/1455697?v=3","gravatar_id":"","url":"https://api.github.com/users/sfackler","html_url":"https://github.com/sfackler","followers_url":"https://api.github.com/users/sfackler/followers","following_url":"https://api.github.com/users/sfackler/following{/other_user}","gists_url":"https://api.github.com/users/sfackler/gists{/gist_id}","starred_url":"https://api.github.com/users/sfackler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfackler/subscriptions","organizations_url":"https://api.github.com/users/sfackler/orgs","repos_url":"https://api.github.com/users/sfackler/repos","events_url":"https://api.github.com/users/sfackler/events{/privacy}","received_events_url":"https://api.github.com/users/sfackler/received_events","type":"User","site_admin":false},"repo":{"id":15500883,"name":"rust-openssl","full_name":"sfackler/rust-openssl","owner":{"login":"sfackler","id":1455697,"avatar_url":"https://avatars.githubusercontent.com/u/1455697?v=3","gravatar_id":"","url":"https://api.github.com/users/sfackler","html_url":"https://github.com/sfackler","followers_url":"https://api.github.com/users/sfackler/followers","following_url":"https://api.github.com/users/sfackler/following{/other_user}","gists_url":"https://api.github.com/users/sfackler/gists{/gist_id}","starred_url":"https://api.github.com/users/sfackler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sfackler/subscriptions","organizations_url":"https://api.github.com/users/sfackler/orgs","repos_url":"https://api.github.com/users/sfackler/repos","events_url":"https://api.github.com/users/sfackler/events{/privacy}","received_events_url":"https://api.github.com/users/sfackler/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sfackler/rust-openssl","description":"OpenSSL bindings for Rust","fork":false,"url":"https://api.github.com/repos/sfackler/rust-openssl","forks_url":"https://api.github.com/repos/sfackler/rust-openssl/forks","keys_url":"https://api.github.com/repos/sfackler/rust-openssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sfackler/rust-openssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sfackler/rust-openssl/teams","hooks_url":"https://api.github.com/repos/sfackler/rust-openssl/hooks","issue_events_url":"https://api.github.com/repos/sfackler/rust-openssl/issues/events{/number}","events_url":"https://api.github.com/repos/sfackler/rust-openssl/events","assignees_url":"https://api.github.com/repos/sfackler/rust-openssl/assignees{/user}","branches_url":"https://api.github.com/repos/sfackler/rust-openssl/branches{/branch}","tags_url":"https://api.github.com/repos/sfackler/rust-openssl/tags","blobs_url":"https://api.github.com/repos/sfackler/rust-openssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sfackler/rust-openssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sfackler/rust-openssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/sfackler/rust-openssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sfackler/rust-openssl/statuses/{sha}","languages_url":"https://api.github.com/repos/sfackler/rust-openssl/languages","stargazers_url":"https://api.github.com/repos/sfackler/rust-openssl/stargazers","contributors_url":"https://api.github.com/repos/sfackler/rust-openssl/contributors","subscribers_url":"https://api.github.com/repos/sfackler/rust-openssl/subscribers","subscription_url":"https://api.github.com/repos/sfackler/rust-openssl/subscription","commits_url":"https://api.github.com/repos/sfackler/rust-openssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/sfackler/rust-openssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/sfackler/rust-openssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/sfackler/rust-openssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/sfackler/rust-openssl/contents/{+path}","compare_url":"https://api.github.com/repos/sfackler/rust-openssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sfackler/rust-openssl/merges","archive_url":"https://api.github.com/repos/sfackler/rust-openssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sfackler/rust-openssl/downloads","issues_url":"https://api.github.com/repos/sfackler/rust-openssl/issues{/number}","pulls_url":"https://api.github.com/repos/sfackler/rust-openssl/pulls{/number}","milestones_url":"https://api.github.com/repos/sfackler/rust-openssl/milestones{/number}","notifications_url":"https://api.github.com/repos/sfackler/rust-openssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sfackler/rust-openssl/labels{/name}","releases_url":"https://api.github.com/repos/sfackler/rust-openssl/releases{/id}","deployments_url":"https://api.github.com/repos/sfackler/rust-openssl/deployments","created_at":"2013-12-28T23:56:50Z","updated_at":"2016-08-03T03:58:15Z","pushed_at":"2016-08-06T18:48:50Z","git_url":"git://github.com/sfackler/rust-openssl.git","ssh_url":"git@github.com:sfackler/rust-openssl.git","clone_url":"https://github.com/sfackler/rust-openssl.git","svn_url":"https://github.com/sfackler/rust-openssl","homepage":"","size":11456,"stargazers_count":197,"watchers_count":197,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":149,"mirror_url":null,"open_issues_count":46,"forks":149,"open_issues":46,"watchers":197,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sfackler/rust-openssl/pulls/437"},"html":{"href":"https://github.com/sfackler/rust-openssl/pull/437"},"issue":{"href":"https://api.github.com/repos/sfackler/rust-openssl/issues/437"},"comments":{"href":"https://api.github.com/repos/sfackler/rust-openssl/issues/437/comments"},"review_comments":{"href":"https://api.github.com/repos/sfackler/rust-openssl/pulls/437/comments"},"review_comment":{"href":"https://api.github.com/repos/sfackler/rust-openssl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sfackler/rust-openssl/pulls/437/commits"},"statuses":{"href":"https://api.github.com/repos/sfackler/rust-openssl/statuses/c036de7c3e4079bc605d26c51a9f02d0018d2bc1"}}}}
{"actor":{"display_login":"rfw"}}