cURL / Mailing Lists / curl-library / Single Mail

curl-library

libcurl: SFTP return quote command failure (21)

From: chu ngoc hung <hungcn_at_gmail.com>
Date: Tue, 26 Feb 2013 11:35:49 +0700

Hi,

I use CURLOPT_QUOTE command to list content of a directory. Here is my code:

    // set url
    //...

    headerlist = curl_slist_append(headerlist, buf_0);
    const char *buf_1 = "CWD /hungcn";
    headerlist = curl_slist_append(headerlist, buf_1);
    curl_easy_setopt(_curl, CURLOPT_QUOTE, headerlist);
    //=====================

    curl_easy_setopt(_curl, CURLOPT_VERBOSE, 1L);
    curl_easy_setopt(_curl, CURLOPT_CUSTOMREQUEST, "LIST");
    curl_easy_setopt(_curl, CURLOPT_WRITEDATA, list);
    curl_easy_setopt(_curl, CURLOPT_WRITEFUNCTION, handleDirectoryList);

When I perform this command it always returns CURLE_QUOTE_ERROR code and
here is log:

* About to connect() to 192.168.1.125 port 22 (#0)
* Trying 192.168.1.125...
* 0x538f004 is at send pipe head!
* STATE: CONNECT => WAITCONNECT handle 0x1ca8604; line 1032 (connection #0)
* Connected to 192.168.1.125 (192.168.1.125) port 22 (#0)
* SFTP 0x209679c state change from SSH_STOP to SSH_INIT
* SFTP 0x209679c state change from SSH_INIT to SSH_S_STARTUP
* STATE: WAITCONNECT => PROTOCONNECT handle 0x1ca8604; line 1145
(connection #0)
* SFTP 0x209679c state change from SSH_S_STARTUP to SSH_HOSTKEY
* SSH MD5 fingerprint: 97409082c5ab0696b635e9785cf19209
* SFTP 0x209679c state change from SSH_HOSTKEY to SSH_AUTHLIST
* SSH authentication methods available: password
* SFTP 0x209679c state change from SSH_AUTHLIST to SSH_AUTH_PKEY_INIT
* SFTP 0x209679c state change from SSH_AUTH_PKEY_INIT to SSH_AUTH_PASS_INIT
* SFTP 0x209679c state change from SSH_AUTH_PASS_INIT to SSH_AUTH_PASS
* Initialized password authentication
* SFTP 0x209679c state change from SSH_AUTH_PASS to SSH_AUTH_DONE
* Authentication complete
* SFTP 0x209679c state change from SSH_AUTH_DONE to SSH_SFTP_INIT
* SFTP 0x209679c state change from SSH_SFTP_INIT to SSH_SFTP_REALPATH
* SSH CONNECT phase done
* SFTP 0x209679c state change from SSH_SFTP_REALPATH to SSH_STOP
* STATE: PROTOCONNECT => DO handle 0x1ca8604; line 1164 (connection #0)
* DO phase starts
* SFTP 0x209679c state change from SSH_STOP to SSH_SFTP_QUOTE_INIT
* Sending quote commands
* SFTP 0x209679c state change from SSH_SFTP_QUOTE_INIT to SSH_SFTP_QUOTE
* Unknown SFTP command
* SFTP 0x209679c state change from SSH_SFTP_QUOTE to SSH_SFTP_CLOSE
* SFTP DONE done
* SFTP 0x209679c state change from SSH_SFTP_CLOSE to SSH_STOP
* DO phase is complete
* Connection #0 to host 192.168.1.125 left intact

Can you help me resolve this?

-- 
Chu Ngọc Hưng
Hanoi University Of Technology
Tel:+84904010806
E-Mail: hungcn_at_gmail.com, or ngochunghutit_at_yahoo.com

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-02-26