Race condition/ deadlock when using LittleProxy for sftp

49 views
Skip to first unread message

Luky Chan

unread,
Feb 27, 2017, 2:32:38 PM2/27/17
to LittleProxy
Hi, I came across race condition in LittleProxy when trying to communicate with sftp/ssh server.
The first step after creating ssh connection is that server and client sends each other their identification. 
Problem happens in connect stage when Connection between proxy and client is not yet fully initialised  (ProxyConnection.isConnecting()==true) and the server send its identification to client (ServerSessionImpl.sendIdentification()).
When this state happens data are passed by ProxyToServerConnection.read method to this.connectionFlow.read(msg) where it is silently discarded (ConnectionFlowStep.read(ConnectionFlow flow, Object msg)).
Client, which didn't receive identification message than wait's for it till the connection is terminated on timeout (get idle).
Proper solution should be to wait with sending the message till the connection is fully established - similarly as it is done in write(Object msg) method of ProxyToServer connection.

If you have any question let me know

  Cheers 
  Lukas
Reply all
Reply to author
Forward
0 new messages