curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder Daniel himself.

Re: When CURLOPT_RANGE is specified in the FTP protocol, does it ever write out-of-range data?

From: Yoshimasa Ohno via curl-library <curl-library_at_lists.haxx.se>
Date: Fri, 8 Aug 2025 05:23:57 +0900

> FTP has a command to
instruct the server where to start reading from, and then curl stops reading
at the end of the range.

Thanks for the reply.

I see that curl will process to the specified RANGE before passing it to
WRITEFUNCTION.
I will implement it with that expectation.

2025年8月8日(金) 0:27 Daniel Stenberg <daniel_at_haxx.se>:

> On Thu, 7 Aug 2025, Yoshimasa Ohno via curl-library wrote:
>
> > In the application, I am trying to specify the retrieval range in
> > CURLOPT_RANGE and write incoming data through CURLOPT_WRITEFUNCTION.
> >
> > As far as I can tell, the callback to CURLOPT_WRITEFUNCTION doesn't seem
> to
> > pass over data outside the range specified by CURLOPT_RANGE. Is this a
> > coincidence? Or is it designed that way?
>
> It is designed that way. You ask for a range, you get that range.
>
> > Since the FTP protocol does not have a range specification (end-of-range
> > specification) mechanism, we expect that the libcurl side is designed to
> > ignore out-of-range data.
>
> curl makes sure to deliver what the user asks for! FTP has a command to
> instruct the server where to start reading from, and then curl stops
> reading
> at the end of the range. Easy peacy!
>
> --
>
> / daniel.haxx.se || https://rock-solid.curl.dev
>


-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2025-08-07