##// END OF EJS Templates
rust-chg: indent process_message() to prepare mass rewrite to futures-0.3...
Yuya Nishihara -
r45185:f8780482 default
parent child Browse files
Show More
@@ -140,30 +140,31 b' where'
140 140 C: Connection,
141 141 H: SystemHandler,
142 142 {
143 match msg {
144 ChannelMessage::Data(b'r', data) => {
145 let code = message::parse_result_code(data)?;
146 Ok(AsyncS::Ready((client, handler, code)))
147 }
148 ChannelMessage::Data(..) => {
149 // just ignores data sent to optional channel
150 let msg_loop = MessageLoop::resume(client);
151 Ok(AsyncS::PollAgain(CommandState::Running(msg_loop, handler)))
152 }
153 ChannelMessage::InputRequest(..) | ChannelMessage::LineRequest(..) => Err(io::Error::new(
154 io::ErrorKind::InvalidData,
155 "unsupported request",
156 )),
157 ChannelMessage::SystemRequest(data) => {
158 let (cmd_type, cmd_spec) = message::parse_command_spec(data)?;
159 match cmd_type {
160 CommandType::Pager => {
161 let fut = handler.spawn_pager(cmd_spec).into_future();
162 Ok(AsyncS::PollAgain(CommandState::SpawningPager(client, fut)))
163 }
164 CommandType::System => {
165 let fut = handler.run_system(cmd_spec).into_future();
166 Ok(AsyncS::PollAgain(CommandState::WaitingSystem(client, fut)))
143 {
144 match msg {
145 ChannelMessage::Data(b'r', data) => {
146 let code = message::parse_result_code(data)?;
147 Ok(AsyncS::Ready((client, handler, code)))
148 }
149 ChannelMessage::Data(..) => {
150 // just ignores data sent to optional channel
151 let msg_loop = MessageLoop::resume(client);
152 Ok(AsyncS::PollAgain(CommandState::Running(msg_loop, handler)))
153 }
154 ChannelMessage::InputRequest(..) | ChannelMessage::LineRequest(..) => Err(
155 io::Error::new(io::ErrorKind::InvalidData, "unsupported request"),
156 ),
157 ChannelMessage::SystemRequest(data) => {
158 let (cmd_type, cmd_spec) = message::parse_command_spec(data)?;
159 match cmd_type {
160 CommandType::Pager => {
161 let fut = handler.spawn_pager(cmd_spec).into_future();
162 Ok(AsyncS::PollAgain(CommandState::SpawningPager(client, fut)))
163 }
164 CommandType::System => {
165 let fut = handler.run_system(cmd_spec).into_future();
166 Ok(AsyncS::PollAgain(CommandState::WaitingSystem(client, fut)))
167 }
167 168 }
168 169 }
169 170 }
General Comments 0
You need to be logged in to leave comments. Login now