cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: multi Error Code 23 (Failed writing body) corner case

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Fri, 3 Oct 2014 07:29:25 +0200

On Thu, Oct 02, 2014 at 02:42:58PM -0400, Dan Donahue wrote:
> This is my first post to the libcurl mailing list. My hope is this mail
> is "etiquettely" correct according to your mailing list rules, which I
> read in their entirety.

Bonus points!

> Please review the info below and provide feedback that will help me
> isolate the issue to either my application or libcurl.
>
> Info
> ----
> Embedded PowerPC CPU
> libcurl 7.29.0

FYI, this version is 10 versions out of date.

> linux kernel 3.0.34
> libssh2 1.4.3
> openssl 1.0.1e
>
> All multi sessions contained herein use sftp employing username and
> password for authentication.
>
> Issue
> -----
> A second failed upload attempt ("Login denied (67)") during a download
> in process causes said download to fail with: "Failed writing received
> data to disk/application (23)". This only occurs if an upload was
> attempted and failed prior to initiating the download.

I'm confused already. Is libcurl returning error 67 or error 23? It's only
going to return a single error code.

> Note, the 67 error is expected because the wrong username is used.
>
> Download progress reports received before the second upload attempt
> indicate download is proceeding as expected. The 23 error occurs
> immediately after the second 67 error.

So, are you describing a scenario consisting of 3 transfers, one that returns
67, a second one that returns 67 then a third one that returns 23?

> The 23 error occurs because the fwrite in the write function did not
> write out all the data given (e.g. 209 != 2000). ferror for the failed
> fwrite reports "Bad file descriptor". This occurs whether I use the
> libcurl default write function or a registered callback.

This sounds like an issue with the write callback or setting up the file handle
used by the write callback. Unfortunately, those were the parts of the code you
didn't send!

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-10-03