/// Process a Control Protocol REDIRECT message.
Process a Control Protocol REDIRECT message.
Process a Control Protocol REDIRECT message .
fn process_redirect_message(&mut self, msg: &[u8]) -> SocketEventResult {
        if self.state == ProtocolState::Established {
            let ptr  = msg.as_ptr();
            let cstr = unsafe {
                CStr::from_ptr(ptr as *const _)
            };
            let addr = String::from_utf8_lossy(cstr.to_bytes());
            Ok(Some(addr.to_string()))
        } else {
            Err(ArrowError::other("cannot handle REDIRECT message in the Handshake state"))
        }
    }
fn process_redirect_message ( & mut self , msg : & [ u8 ] ) -> SocketEventResult { if self . state == ProtocolState :: Established { let ptr = msg . as_ptr ( ) ; let cstr = unsafe { CStr :: from_ptr ( ptr as * const _ ) } ; let addr = String :: from_utf8_lossy ( cstr . to_bytes ( ) ) ; Ok ( Some ( addr . to_string ( ) ) ) } else { Err ( ArrowError :: other ( " " ) ) } }
Process a Control Protocol REDIRECT message.
Process a Control Protocol REDIRECT message .
&mut self
msg
&[u8]