@@ -264,7 +264,7 @@ handle_data(0, ChannelId, <<?UINT32(Len), Msg:Len/binary, Rest/binary>>,
264264 end ;
265265handle_data (0 , _ChannelId , Data , State = # state {pending = <<>>}) ->
266266 {ok , State # state {pending = Data }};
267- handle_data (Type , ChannelId , Data0 , State = # state {pending = Pending }) ->
267+ handle_data (0 , ChannelId , Data0 , State = # state {pending = Pending }) ->
268268 Data = <<Pending /binary , Data0 /binary >>,
269269 Size = byte_size (Data ),
270270 case Size > ? SSH_MAX_PACKET_SIZE of
@@ -285,8 +285,11 @@ handle_data(Type, ChannelId, Data0, State = #state{pending = Pending}) ->
285285 ? LOG_ERROR (ReportFun , [Size ]),
286286 {stop , ChannelId , State };
287287 _ ->
288- handle_data (Type , ChannelId , Data , State # state {pending = <<>>})
289- end .
288+ handle_data (0 , ChannelId , Data , State # state {pending = <<>>})
289+ end ;
290+ handle_data (_Type , _ChannelId , _Data , State ) ->
291+ % % Same as openssh sftpd, we ignore extended data
292+ {ok , State }.
290293
291294% % From draft-ietf-secsh-filexfer-02 "The file handle strings MUST NOT be longer than 256 bytes."
292295handle_op (Request , ReqId , <<? UINT32 (HLen ), _ /binary >>, State = # state {xf = XF })
0 commit comments