Commit 722a2bd6 authored by Shaun Taheri's avatar Shaun Taheri Committed by Shaun Taheri
Browse files

Set SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER flag

parent 85f5b862
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
+1 −1
Original line number Diff line number Diff line
@@ -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);