From f37dc9168a3c793e9f29e7708c7783c6cc44a185 Mon Sep 17 00:00:00 2001
From: James Housley <jim@thehousleys.net>
Date: Wed, 13 Jun 2007 17:13:44 +0000
Subject: [PATCH] Restore functionality mistakenly removed in the previous
 commit

---
 lib/ssh.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/ssh.c b/lib/ssh.c
index 23a1d3bda4..e7935ad243 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -651,7 +651,10 @@ static CURLcode ssh_statemach_act(struct connectdata *conn)
       break;
 
     case SSH_SESSION_FREE:
-      libssh2_session_free(ssh->ssh_session);
+      rc = libssh2_session_free(ssh->ssh_session);
+      if (rc == LIBSSH2_ERROR_EAGAIN) {
+        break;
+      }
       ssh->ssh_session = NULL;
       state(conn, SSH_STOP);
       result = sshc->actualCode;
-- 
GitLab