In my original post I also showed that using libssh2 with libssh2_sftp functions was just as slow as libcurl, 320 ms vs 120 ms using the curl command.
I have now fixed the performance of libssh2 by adding this line to xpsSFTPUpload.cpp
setsockopt(sockFD, SOL_TCP, TCP_NODELAY, &one, sizeof(one));
This is the time before adding that line:
corvette:motorNewport/newportApp/src>../../../../bin/linux-x86_64/testSFTPUpload
Calling xpsSFTPUpload
Fingerprint: 89 36 E6 AF D0 11 C6 BA 21 CD 68 FC 26 0C 31 73 5C 4B CC 1A
xpsSFTPUpload returned status=0, elapsed time=0.326530
This is the time after adding that line:
corvette:motorNewport/newportApp/src>../../../../bin/linux-x86_64/testSFTPUpload
Calling xpsSFTPUpload
Fingerprint: 89 36 E6 AF D0 11 C6 BA 21 CD 68 FC 26 0C 31 73 5C 4B CC 1A
xpsSFTPUpload returned status=0, elapsed time=0.115006
So now curl, libcurl, and libssh2 all take about 120 ms.
Mark