diff options
| author | Andreas Schneider <mail@cynapses.org> | 2009-07-28 14:13:22 +0200 |
|---|---|---|
| committer | Andreas Schneider <mail@cynapses.org> | 2009-07-28 14:13:22 +0200 |
| commit | b4111c5c187cf9212eba0ae459edb630dbddb656 (patch) | |
| tree | 0a8351dffea74df590633c85bc76fde4c0f4c6b0 /sample.c | |
| parent | b9b7174d858faa070e66db9b7710c384756f90fc (diff) | |
| download | libssh-b4111c5c187cf9212eba0ae459edb630dbddb656.tar.gz libssh-b4111c5c187cf9212eba0ae459edb630dbddb656.tar.xz libssh-b4111c5c187cf9212eba0ae459edb630dbddb656.zip | |
Add functions to get the extension count, name and data.
Diffstat (limited to 'sample.c')
| -rw-r--r-- | sample.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -283,10 +283,12 @@ void do_sftp(SSH_SESSION *session){ SFTP_FILE *fichier; SFTP_FILE *to; int len=1; - int i; + unsigned int i; char data[8000]={0}; char *link; + unsigned int count; + if(!sftp_session){ fprintf(stderr, "sftp error initialising channel: %s\n", ssh_get_error(session)); @@ -298,6 +300,14 @@ void do_sftp(SSH_SESSION *session){ return; } + printf("Additional SFTP extensions provided by the server:\n"); + count = sftp_extensions_get_count(sftp_session); + for (i = 0; i < count; i++) { + printf("\t%s, version: %s\n", + sftp_extensions_get_name(sftp_session, i), + sftp_extensions_get_data(sftp_session, i)); + } + /* test symlink and readlink */ if (sftp_symlink(sftp_session, "/tmp/this_is_the_link", "/tmp/sftp_symlink_test") < 0) { |
