Merge pull request #423 from taheris/fix/moving-write-buffer

Set SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag
This commit is contained in:
Steven Fackler 2016-07-24 12:14:12 -07:00 committed by GitHub
commit bdfa54cfdb
2 changed files with 2 additions and 1 deletions

View File

@ -272,6 +272,7 @@ pub const SSL_CTRL_SET_TLSEXT_HOSTNAME: c_int = 55;
pub const SSL_CTRL_EXTRA_CHAIN_CERT: c_int = 14;
pub const SSL_CTRL_SET_READ_AHEAD: c_int = 41;
pub const SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER: c_long = 2;
pub const SSL_MODE_AUTO_RETRY: c_long = 4;
pub const SSL_ERROR_NONE: c_int = 0;

View File

@ -567,7 +567,7 @@ impl SslContext {
let ctx = SslContext { ctx: ctx };
// this is a bit dubious (?)
try!(ctx.set_mode(ffi::SSL_MODE_AUTO_RETRY));
try!(ctx.set_mode(ffi::SSL_MODE_AUTO_RETRY | ffi::SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER));
if method.is_dtls() {
ctx.set_read_ahead(1);