summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Housley <jim@thehousleys.net>2007-06-14 10:36:53 +0000
committerJames Housley <jim@thehousleys.net>2007-06-14 10:36:53 +0000
commit82d3f97659d48383ca6b4816fc29a11d1e0ae7ee (patch)
treec966f5f45228b47c658280f01c9ae19cae83b3de
parent235632ed2c99c4859fe2142cc2f7f8daf74967fe (diff)
downloadgnurl-82d3f97659d48383ca6b4816fc29a11d1e0ae7ee.tar.gz
gnurl-82d3f97659d48383ca6b4816fc29a11d1e0ae7ee.tar.bz2
gnurl-82d3f97659d48383ca6b4816fc29a11d1e0ae7ee.zip
BUG FIX: When reading a directory listing that contains symlinks
with the latest libssh2, the listing would be truncated at the symlink. Fix by looping on LIBSSH2_ERROR_EAGAIN, like the rest of the calls.
-rw-r--r--lib/ssh.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/ssh.c b/lib/ssh.c
index e7935ad24..bc7d3eb41 100644
--- a/lib/ssh.c
+++ b/lib/ssh.c
@@ -1573,8 +1573,14 @@ CURLcode Curl_sftp_do(struct connectdata *conn, bool *done)
char linkPath[PATH_MAX + 1];
snprintf(linkPath, PATH_MAX, "%s%s", sftp->path, filename);
+#if (LIBSSH2_APINO >= 200706012030)
+ while ((len = libssh2_sftp_readlink(sftp->sftp_session, linkPath,
+ filename, PATH_MAX)) ==
+ LIBSSH2_ERROR_EAGAIN);
+#else /* !(LIBSSH2_APINO >= 200706012030) */
len = libssh2_sftp_readlink(sftp->sftp_session, linkPath,
filename, PATH_MAX);
+#endif /* !(LIBSSH2_APINO >= 200706012030) */
line = realloc(line, totalLen + 4 + len);
if (!line)
return CURLE_OUT_OF_MEMORY;