X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:to:message-id:subject :mime-version:references:content-type:content-transfer-encoding; q=dns; s=default; b=Npo1s3YQMtfOdxseQDi15Gp9vOq90IlUXzzqUIsTt+9 5qzn0iIHawo2BdK+MdZe7dYc3KGvsWsjJ5U5I90B7LTYWc8m+Tad605xu+YInoul hb1GvukiS2wwTXMTjwlN7YEcBYGOY+oc8zwRfgkqcADVQIxvN/V4jiw/Rz0PUgdY = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:from:reply-to:to:message-id:subject :mime-version:references:content-type:content-transfer-encoding; s=default; bh=g4tDZ4Zp7sA5U6gvH9215gcXzjI=; b=OIFaYKsryjW+S1Urh UM+typ771aBnGhFx+amm2qGiuWp9Yvya89dGeJfZ9ArtFzy9bmUASjPefgy4Hnk0 QMdNo/hFXZSoKRgHtRSfD6yqmH2uEEADmJa/+WBRsLXeC0GAw1qIB1Sv9O5fbZKO bc+xizduu/wn7NhXYTtbhQPCLU= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=1.1 required=5.0 tests=BAYES_50,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.1 spammy=H*F:D*yahoo.com, H*x:WebService, H*x:Mozilla, H*x:20100101 X-HELO: sonic303-22.consmr.mail.ne1.yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1567799057; bh=f+N5OxOL87xmfr8Q+THkgGV67rFKGQbvgFcYIiIaiqw=; h=Date:From:To:Subject:References:From:Subject; b=CV5d8/3oq4ft3RkAmHe+XPKUoMOQtiKlz1o/5gfFTWDJWHA0Hu98ZHyMC71n4XKxL+W3de5Zr59aqZ3Xhm4EmHZliwURdgzAVkReO+81lFIgtuEUvHqjUL+0g0EYAyv5uhj9aboUz959LoWqhc26LwJHVnfWTUbvfmntQW1mNwfQeadSohKw7BzZbp3euNpcYgzUamRIFnSzMO8dV/5uAg9SGftW4u5IX1PfuVwUVHbf60C5feuLwO0Wn4YG59bG+qu+1ok9bpDDXAz+D2RNtziMGOyvNGBU3sScU8bbMd+os8uBhwCNDCDauG06x5bYZ/XbeZwvy7xx46sUdtFqpg== Date: Fri, 6 Sep 2019 19:44:12 +0000 (UTC) From: "ALbert via cygwin" Reply-To: ALbert To: "cygwin AT cygwin DOT com" Message-ID: <154000859.3440830.1567799052771@mail.yahoo.com> Subject: cURL uploads 0 length file for sftp transfer. MIME-Version: 1.0 References: <154000859 DOT 3440830 DOT 1567799052771 DOT ref AT mail DOT yahoo DOT com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id x86JirQV027248 We recently upgraded cURL from version:curl 7.50.3 (i686-pc-cygwin) libcurl/7.50.3 OpenSSL/1.0.2j zlib/1.2.8 libidn/1.29 libpsl/0.14.0 (+libidn/1.29) libssh2/1.7.0 nghttp2/1.14.0tocurl 7.64.1 (i686-pc-cygwin) libcurl/7.65.3 OpenSSL/1.1.1c zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.0.4) libssh/0.8.7/openssl/zlib nghttp2/1.37.0 Since the upgrade, we've seen problems uploading text files to sftp servers. Here's the call that we make: curl--trace-ascii trace.txt -k sftp://:@/file.txt-T file.txt On initial call, a 0-length file is uploaded, with successful return code. On immediate rerun, a full file is uploaded (if we wait few minutes, 0-length file will get uploaded). Below are the traces from initial and subsequent calls. We also tried using same version curl on a linux box, without any issues. We also downloaded latest version of curl from curl for Windows, "curl 7.65.3 (i386-pc-win32) libcurl/7.65.3 OpenSSL/1.1.1c (Schannel) zlib/1.2.11 brotli/1.0.7 WinIDN libssh2/1.9.0 nghttp2/1.39.2", and its also working correctly. Unfortunately, the server we're uploading to belongs to a client, and we can't see if this is an issue on a server side. However, even if it was, why would linux curl and windows curl (from curl.haxx.se) would work correctly? Any help or pointers would be appreciated. Thank you. Here's the trace files: From initial call:== Info: STATE: INIT => CONNECT handle 0x80068340; line 1356 (connection #-5000) == Info: Added connection 0. The cache now contains 1 members == Info: STATE: CONNECT => WAITRESOLVE handle 0x80068340; line 1397 (connection #0) == Info:   Trying XXX.XX.XX.XX...== Info: TCP_NODELAY set == Info: STATE: WAITRESOLVE => WAITCONNECT handle 0x80068340; line 1476 (connection #0) == Info: Connected to XXXXXXX ( XXX.XX.XX.XX) port 22 (#0)== Info: STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x80068340; line 1532 (connection #0) == Info: Marked for [keep alive]: SSH default == Info: User: Opus_efg == Info: SSH 0x80048f90 state change from SSH_STOP to SSH_INIT (line 2115) == Info: SSH 0x80048f90 state change from SSH_INIT to SSH_S_STARTUP (line 582) == Info: STATE: SENDPROTOCONNECT => PROTOCONNECT handle 0x80068340; line 1547 (connection #0) == Info: SSH 0x80048f90 state change from SSH_S_STARTUP to SSH_HOSTKEY (line 595) == Info: SSH 0x80048f90 state change from SSH_HOSTKEY to SSH_AUTHLIST (line 605) == Info: SSH 0x80048f90 state change from SSH_AUTHLIST to SSH_AUTH_PKEY_INIT (line 628) == Info: Authentication using SSH public key file == Info: SSH 0x80048f90 state change from SSH_AUTH_PKEY_INIT to SSH_AUTH_KEY_INIT (line 697) == Info: SSH 0x80048f90 state change from SSH_AUTH_KEY_INIT to SSH_AUTH_KEY (line 743) == Info: completed keyboard interactive authentication == Info: SSH 0x80048f90 state change from SSH_AUTH_KEY to SSH_AUTH_DONE (line 761) == Info: Authentication complete == Info: SSH 0x80048f90 state change from SSH_AUTH_DONE to SSH_SFTP_INIT (line 807) == Info: SSH 0x80048f90 state change from SSH_SFTP_INIT to SSH_SFTP_REALPATH (line 833) == Info: SSH CONNECT phase done == Info: SSH 0x80048f90 state change from SSH_SFTP_REALPATH to SSH_STOP (line 850) == Info: STATE: PROTOCONNECT => DO handle 0x80068340; line 1566 (connection #0) == Info: DO phase starts == Info: SSH 0x80048f90 state change from SSH_STOP to SSH_SFTP_QUOTE_INIT (line 2332) == Info: SSH 0x80048f90 state change from SSH_SFTP_QUOTE_INIT to SSH_SFTP_GETINFO (line 868) == Info: SSH 0x80048f90 state change from SSH_SFTP_GETINFO to SSH_SFTP_TRANS_INIT (line 1060) == Info: SSH 0x80048f90 state change from SSH_SFTP_TRANS_INIT to SSH_SFTP_UPLOAD_INIT (line 1080) == Info: SSH 0x80048f90 state change from SSH_SFTP_UPLOAD_INIT to SSH_SFTP_CLOSE (line 1143) == Info: STATE: DO => DOING handle 0x80068340; line 1608 (connection #0) == Info: SFTP DONE done == Info: SSH 0x80048f90 state change from SSH_SFTP_CLOSE to SSH_STOP (line 1651) == Info: DO phase is complete == Info: STATE: DOING => DO_DONE handle 0x80068340; line 1693 (connection #0) == Info: STATE: DO_DONE => PERFORM handle 0x80068340; line 1743 (connection #0) == Info: STATE: PERFORM => DONE handle 0x80068340; line 1933 (connection #0) == Info: multi_done == Info: SSH 0x80048f90 state change from SSH_STOP to SSH_SFTP_CLOSE (line 2390) == Info: SFTP DONE done == Info: SSH 0x80048f90 state change from SSH_SFTP_CLOSE to SSH_STOP (line 1651) == Info: Connection #0 to host XXXXXXX left intact Trace from subsequent call:== Info: STATE: INIT => CONNECT handle 0x80068340; line 1356 (connection #-5000) == Info: Added connection 0. The cache now contains 1 members == Info: STATE: CONNECT => WAITRESOLVE handle 0x80068340; line 1397 (connection #0) == Info:   Trying XXX.XX.XX.XX...== Info: TCP_NODELAY set == Info: STATE: WAITRESOLVE => WAITCONNECT handle 0x80068340; line 1476 (connection #0) == Info: Connected to XXXXXXX (XXX.XX.XX.XX) port 22 (#0) == Info: STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x80068340; line 1532 (connection #0) == Info: Marked for [keep alive]: SSH default == Info: User: Opus_efg == Info: SSH 0x80048f90 state change from SSH_STOP to SSH_INIT (line 2115) == Info: SSH 0x80048f90 state change from SSH_INIT to SSH_S_STARTUP (line 582) == Info: STATE: SENDPROTOCONNECT => PROTOCONNECT handle 0x80068340; line 1547 (connection #0) == Info: SSH 0x80048f90 state change from SSH_S_STARTUP to SSH_HOSTKEY (line 595) == Info: SSH 0x80048f90 state change from SSH_HOSTKEY to SSH_AUTHLIST (line 605) == Info: SSH 0x80048f90 state change from SSH_AUTHLIST to SSH_AUTH_PKEY_INIT (line 628) == Info: Authentication using SSH public key file == Info: SSH 0x80048f90 state change from SSH_AUTH_PKEY_INIT to SSH_AUTH_KEY_INIT (line 697) == Info: SSH 0x80048f90 state change from SSH_AUTH_KEY_INIT to SSH_AUTH_KEY (line 743) == Info: completed keyboard interactive authentication == Info: SSH 0x80048f90 state change from SSH_AUTH_KEY to SSH_AUTH_DONE (line 761) == Info: Authentication complete == Info: SSH 0x80048f90 state change from SSH_AUTH_DONE to SSH_SFTP_INIT (line 807) == Info: SSH 0x80048f90 state change from SSH_SFTP_INIT to SSH_SFTP_REALPATH (line 833) == Info: SSH CONNECT phase done == Info: SSH 0x80048f90 state change from SSH_SFTP_REALPATH to SSH_STOP (line 850) == Info: STATE: PROTOCONNECT => DO handle 0x80068340; line 1566 (connection #0) == Info: DO phase starts == Info: SSH 0x80048f90 state change from SSH_STOP to SSH_SFTP_QUOTE_INIT (line 2332) == Info: SSH 0x80048f90 state change from SSH_SFTP_QUOTE_INIT to SSH_SFTP_GETINFO (line 868) == Info: SSH 0x80048f90 state change from SSH_SFTP_GETINFO to SSH_SFTP_TRANS_INIT (line 1060) == Info: SSH 0x80048f90 state change from SSH_SFTP_TRANS_INIT to SSH_SFTP_UPLOAD_INIT (line 1080) == Info: SSH 0x80048f90 state change from SSH_SFTP_UPLOAD_INIT to SSH_STOP (line 1222) == Info: DO phase is complete == Info: STATE: DO => DO_DONE handle 0x80068340; line 1621 (connection #0) == Info: STATE: DO_DONE => PERFORM handle 0x80068340; line 1743 (connection #0) => Send data, 10688 bytes (0x29c0)   SENSITIVE DATA DELETED == Info: We are completely uploaded and fine == Info: STATE: PERFORM => DONE handle 0x80068340; line 1933 (connection #0) == Info: multi_done == Info: SSH 0x80048f90 state change from SSH_STOP to SSH_SFTP_CLOSE (line 2390) == Info: SFTP DONE done == Info: SSH 0x80048f90 state change from SSH_SFTP_CLOSE to SSH_STOP (line 1651) == Info: Connection #0 to host XXXXXXX left intact == Info: Expire cleared (transfer 0x80068340) -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple