On Tuesday 07 April 2015 09:32:53 Kevin Stewart wrote:
> More information:
> 
> In 0.6.0rc1 I could use WSAAsyncSelect to determine when a client was
> connecting, but in 0.6.4 I can't. I rewrote the code around the
> ssh_bind_listen() to use  select() instead and now things are MOSTLY
> working.
> 
> I am still getting client (putty) disconnects with "Incoming packet was
> garbled on decryption" during the key exchange. I wrote a NodeJS SSH2
> client to test with also, and it is throwing an exception stating "Bad
> packet length".
> 
> On 4/6/2015 6:31 PM, Kevin Stewart wrote:
> I developed a Windows-based (using VS2010) server application using the
> 0.6.0rc1 version of libssh and was getting memory leaks on a per connection
> basis. I decided to migrate to the latest version (0.6.4) to see if it
> alleviated these leaks and ran into different issues. The first issue is in
> socket.c starting at line 314. ssh_socket_set_blocking() is failing and
> WSAGetLastError() is returning 10022 (WSAEINVAL). Since sockets are
> initially in blocking mode ("When a socket is created, it operates in
> blocking mode by default (nonblocking mode is disabled). This is consistent
> with BSD sockets." -
> https://msdn.microsoft.com/en-us/library/windows/desktop/ms738573(v=vs.85).
> aspx), I commented out the section of code to get passed the error. Now,
> during the key exchange, clients (putty), disconnects with "Incoming packet
> was garbled on decryption".

You should use our infrastructure and implement a callback based server.

https://git.libssh.org/projects/libssh.git/tree/examples/ssh_server_fork.c

You should use ssh_event ...

-- 
Andreas Schneider                   GPG-ID: CC014E3D
www.cryptomilk.org                a...@cryptomilk.org


Reply via email to