diff options
| author | Steven Fackler <[email protected]> | 2015-06-25 22:47:53 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2015-06-25 22:47:53 -0700 |
| commit | c8d23f37a40afbb7ccb768241e429a51f94b8e7a (patch) | |
| tree | 2564730c1ad43a5527fb27623213fb778acda0c0 /openssl/src/bio | |
| parent | Merge pull request #225 from semmaz/mingw-build-fix (diff) | |
| download | rust-openssl-c8d23f37a40afbb7ccb768241e429a51f94b8e7a.tar.xz rust-openssl-c8d23f37a40afbb7ccb768241e429a51f94b8e7a.zip | |
Fix EOF handling in retry wrapper
Diffstat (limited to 'openssl/src/bio')
| -rw-r--r-- | openssl/src/bio/mod.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/openssl/src/bio/mod.rs b/openssl/src/bio/mod.rs index ad2f65c2..e81694a4 100644 --- a/openssl/src/bio/mod.rs +++ b/openssl/src/bio/mod.rs @@ -56,6 +56,12 @@ impl MemBio { pub unsafe fn get_handle(&self) -> *mut ffi::BIO { self.bio } + + /// Sets the BIO's EOF state. + pub fn set_eof(&self, eof: bool) { + let v = if eof { 0 } else { -1 }; + unsafe { ffi::BIO_set_mem_eof_return(self.bio, v); } + } } impl Read for MemBio { |