fn send_appdata_encrypt(&mut self,
                            payload: &[u8],
                            limit: Limit) -> usize {
        // Here, the limit on sendable_tls applies to encrypted data,
        // but we're respecting it for plaintext data -- so we'll
        // be out by whatever the cipher+record overhead is.  That's a
        // constant and predictable amount, so it's not a terrible issue.
        let len = match limit {
            Limit::Yes => self.sendable_tls.apply_limit(payload.len()),
            Limit::No => payload.len()
        };

        let mut plain_messages = VecDeque::new();
        self.message_fragmenter.fragment_borrow(ContentType::ApplicationData,
                                                ProtocolVersion::TLSv1_2,
                                                &payload[..len],
                                                &mut plain_messages);

        for m in plain_messages {
            self.send_single_fragment(m);
        }

        len
    }
/// Like send_msg_encrypt, but operate on an appdata directly.
Like send_msg_encrypt, but operate on an appdata directly.
Like send_msg_encrypt but operate on an appdata directly .
fn send_appdata_encrypt(&mut self,
                            payload: &[u8],
                            limit: Limit) -> usize {
        // Here, the limit on sendable_tls applies to encrypted data,
        // but we're respecting it for plaintext data -- so we'll
        // be out by whatever the cipher+record overhead is.  That's a
        // constant and predictable amount, so it's not a terrible issue.
        let len = match limit {
            Limit::Yes => self.sendable_tls.apply_limit(payload.len()),
            Limit::No => payload.len()
        };
        let mut plain_messages = VecDeque::new();
        self.message_fragmenter.fragment_borrow(ContentType::ApplicationData,
                                                ProtocolVersion::TLSv1_2,
                                                &payload[..len],
                                                &mut plain_messages);
        for m in plain_messages {
            self.send_single_fragment(m);
        }
        len
    }
fn send_appdata_encrypt ( & mut self , payload : & [ u8 ] , limit : Limit ) -> usize { // Here, the limit on sendable_tls applies to encrypted data, // but we're respecting it for plaintext data -- so we'll // be out by whatever the cipher+record overhead is.  That's a // constant and predictable amount, so it's not a terrible issue. let len = match limit { Limit :: Yes => self . sendable_tls . apply_limit ( payload . len ( ) ) , Limit :: No => payload . len ( ) } ; let mut plain_messages = VecDeque :: new ( ) ; self . message_fragmenter . fragment_borrow ( ContentType :: ApplicationData , ProtocolVersion :: TLSv1_2 , & payload [ .. len ] , & mut plain_messages ) ; for m in plain_messages { self . send_single_fragment ( m ) ; } len }
Like send_msg_encrypt, but operate on an appdata directly.
Like send_msg_encrypt but operate on an appdata directly .
&mut self
payload
&[u8]
limit
Limit
&mut self
payload
&[u8]
limit
Limit