@@ -312,33 +312,31 @@ impl Inner {
312312 {
313313 return Some ( frame) ;
314314 }
315- if flow {
316- if let Some ( frame) = self . low_prio_frames . pop_front ( ) {
317- // If the next frame is a header, that means we're a basic.publish
318- // Header frame needs to follow directly the basic.publish frame, and Body frames
319- // need to be sent just after those or the AMQP server will close the connection.
320- // Push the header into publish_frames which is there to handle just that.
321- if self
322- . low_prio_frames
323- . front ( )
324- . map ( |frame| frame. is_header ( ) )
325- . unwrap_or ( false )
326- {
327- while let Some ( next_frame) = self . low_prio_frames . pop_front ( ) {
328- match * next_frame {
329- AMQPFrame :: Header ( ..) | AMQPFrame :: Body ( ..) => {
330- self . publish_frames . push_back ( next_frame) ;
331- }
332- _ => {
333- // We've exhausted Body frames for this publish, push back the next one and exit
334- self . low_prio_frames . push_front ( next_frame) ;
335- break ;
336- }
315+ if flow && let Some ( frame) = self . low_prio_frames . pop_front ( ) {
316+ // If the next frame is a header, that means we're a basic.publish
317+ // Header frame needs to follow directly the basic.publish frame, and Body frames
318+ // need to be sent just after those or the AMQP server will close the connection.
319+ // Push the header into publish_frames which is there to handle just that.
320+ if self
321+ . low_prio_frames
322+ . front ( )
323+ . map ( |frame| frame. is_header ( ) )
324+ . unwrap_or ( false )
325+ {
326+ while let Some ( next_frame) = self . low_prio_frames . pop_front ( ) {
327+ match * next_frame {
328+ AMQPFrame :: Header ( ..) | AMQPFrame :: Body ( ..) => {
329+ self . publish_frames . push_back ( next_frame) ;
330+ }
331+ _ => {
332+ // We've exhausted Body frames for this publish, push back the next one and exit
333+ self . low_prio_frames . push_front ( next_frame) ;
334+ break ;
337335 }
338336 }
339337 }
340- return Some ( frame) ;
341338 }
339+ return Some ( frame) ;
342340 }
343341 None
344342 }
0 commit comments