flep 0.2.0

File transfer protocol (FTP) library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use {Error, protocol};
use server::client::{ClientState, Action};

/// Handle the 'TYPE' command.
pub fn handle(ty: &protocol::TYPE,
              client: &mut ClientState) -> Result<Action, Error> {
    let mut session = client.session.expect_ready_mut()?;

    session.transfer_type = ty.file_type;

    debug!("file type set to {:?}", ty.file_type);
    Ok(Action::Reply(protocol::Reply::new(protocol::reply::code::OK, "file type set")))
}