equal
deleted
inserted
replaced
34 return message::parse_result_code(data); |
34 return message::parse_result_code(data); |
35 } |
35 } |
36 ChannelMessage::Data(..) => { |
36 ChannelMessage::Data(..) => { |
37 // just ignores data sent to optional channel |
37 // just ignores data sent to optional channel |
38 } |
38 } |
39 ChannelMessage::InputRequest(..) | ChannelMessage::LineRequest(..) => { |
39 ChannelMessage::InputRequest(..) |
|
40 | ChannelMessage::LineRequest(..) => { |
40 return Err(io::Error::new( |
41 return Err(io::Error::new( |
41 io::ErrorKind::InvalidData, |
42 io::ErrorKind::InvalidData, |
42 "unsupported request", |
43 "unsupported request", |
43 )); |
44 )); |
44 } |
45 } |
47 match cmd_type { |
48 match cmd_type { |
48 CommandType::Pager => { |
49 CommandType::Pager => { |
49 // server spins new command loop while pager request is |
50 // server spins new command loop while pager request is |
50 // in progress, which can be terminated by "" command. |
51 // in progress, which can be terminated by "" command. |
51 let pin = handler.spawn_pager(&cmd_spec).await?; |
52 let pin = handler.spawn_pager(&cmd_spec).await?; |
52 attachio::attach_io(proto, &io::stdin(), &pin, &pin).await?; |
53 attachio::attach_io(proto, &io::stdin(), &pin, &pin) |
|
54 .await?; |
53 proto.send_command("").await?; // terminator |
55 proto.send_command("").await?; // terminator |
54 } |
56 } |
55 CommandType::System => { |
57 CommandType::System => { |
56 let code = handler.run_system(&cmd_spec).await?; |
58 let code = handler.run_system(&cmd_spec).await?; |
57 let data = message::pack_result_code(code); |
59 let data = message::pack_result_code(code); |