Wire up trailers
This commit is contained in:
		| @@ -146,10 +146,20 @@ impl<B> Recv<B> where B: Buf { | ||||
|         Ok(()) | ||||
|     } | ||||
|  | ||||
|     pub fn recv_eos(&mut self, stream: &mut Stream<B>) | ||||
|     /// Transition the stream based on receiving trailers | ||||
|     pub fn recv_trailers<P: Peer>(&mut self, | ||||
|                                   frame: frame::Headers, | ||||
|                                   stream: &mut store::Ptr<B>) | ||||
|         -> Result<(), ConnectionError> | ||||
|     { | ||||
|         stream.state.recv_close() | ||||
|         // Transition the state | ||||
|         stream.state.recv_close(); | ||||
|  | ||||
|         // Push the frame onto the stream's recv buffer | ||||
|         stream.pending_recv.push_back(&mut self.buffer, frame.into()); | ||||
|         stream.notify_recv(); | ||||
|  | ||||
|         Ok(()) | ||||
|     } | ||||
|  | ||||
|     pub fn recv_data(&mut self, | ||||
|   | ||||
| @@ -91,15 +91,12 @@ impl<B> Streams<B> | ||||
|  | ||||
|         me.actions.transition::<P, _, _>(stream, |actions, stream| { | ||||
|             if frame.is_trailers() { | ||||
|                 unimplemented!(); | ||||
|                 /* | ||||
|                 if !frame.is_end_stream() { | ||||
|                     // TODO: What error should this return? | ||||
|                     unimplemented!(); | ||||
|                     // TODO: Is this the right error | ||||
|                     return Err(ProtocolError.into()); | ||||
|                 } | ||||
|  | ||||
|                 try!(me.actions.recv.recv_eos(stream)); | ||||
|                 */ | ||||
|                 actions.recv.recv_trailers::<P>(frame, stream) | ||||
|             } else { | ||||
|                 actions.recv.recv_headers::<P>(frame, stream) | ||||
|             } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user