cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: SFTP file info and state machine

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 30 Jan 2011 16:28:51 +0100 (CET)

On Fri, 28 Jan 2011, John Utz wrote:

> It seems to me that this job should be done only in the state
>
> "SSH_SFTP_QUOTE_STAT"
>
> instead of being spread between SSH_SFTP_QUOTE_STAT and SSH_SCP_TRANS_INIT

No, the QUOTE states are only used for quote commands and the
SSH_SFTP_QUOTE_STAT in specific is only used of a stat-using quote command is
used.

When doing SFTP download, the libssh2_sftp_stat_ex() command is already used
in the SSH_SFTP_DOWNLOAD_STAT state and I figure you should be able to set the
information properly after that point.

> or am i misunderstanding something about how the ssh state machine works?

The state machine is only there to allow the function to never block and be
called again and again and yet do the correct thing. The "path" through the
state machine depends on exactly what kind of request/operation that libcurl
is told to do.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-01-30