cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl crashes when reusing a curl handle over SFTP after calling curl_easy_reset()

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 8 Mar 2008 23:40:55 +0100 (CET)

On Sat, 8 Mar 2008, Brian Ulm wrote:

> The reason I was attempting to use curl_easy_reset() is because I was having
> a different issue when I did not use curl_easy_reset(), which may in fact be
> a legitimate bug.
>
> 1.) Initialize a curl handle
> 2.) Attempt to download a file over SFTP that DOES NOT EXIST on the server.
> 3.) Attempt to download a file from the same server that DOES EXIST.

Oh, I tried it too now and I could repeat this problem too!

I did this tiny fix that seemed to make it work for me:

--- lib/ssh.c 4 Mar 2008 11:53:15 -0000 1.95
+++ lib/ssh.c 8 Mar 2008 22:39:24 -0000
@@ -1966,6 +1966,9 @@
  {
    struct SessionHandle *data = conn->data;
    struct SSHPROTO *ssh;
+
+ conn->proto.sshc.actualcode = CURLE_OK; /* reset error code */
+
    if(data->state.proto.ssh)
      return CURLE_OK;

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-03-08