cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: CURLOPT_RANGE -> chunks -> how to remove MIME-Header-Foo ?

From: Rieker Flaik <rieker_flaik_at_arcor.de>
Date: Tue, 14 Jun 2011 13:31:54 +0200

On Tue, 2011-06-14 at 13:17 +0200, Daniel Stenberg wrote:
> On Tue, 14 Jun 2011, Rieker Flaik wrote:
>
> > But if it succeeds with the server to download chunk by chunk (for
> > example first 5 bytes then the rest)
>
> But why would you ask for such a range in the first place? That seems utterly
> pointless.

I do need to test a hash-tag which is in the first 200 bytes - and if
this differs from the local hash-tag the full file will be downloaded.
So yes, I need this CURLOPT_RANGE and it's very helpful.

What I don't like is the MIME separation header because it means I have
to "parse".

>
> > - it is "using standard MIME separation techniques" which means it adds a
> > kind of header to every chunk.
>
> Yes, if you ask for more than one range the server will send you the ranges
> using MIME separation.
>
> > But I don't want and need this! Or should I?
>
> If you don't want it, then don't ask for it.
>
> > What is the best way to strip this MIME-Header-Foo off?
>
> By using a MIME parser!
>
> > Just remove the first 8 lines of every chunk?
>
> Please don't call them "chunks" as in HTTP lingo that's something completely
> different. MIME separators come in the style:
>
> > --4a5a936502fad6bcc
> > Content-type: text/xml;charset=iso-8859-1
> > Content-range: bytes 0-5/2463
> >
>
> So if you want to filter them out so skip the separators, the following
> headers and the CRLF separator between the headers and the actual content.
>

Thanks, I'll do so. Or do you know of a MIME parser which has this
already implemented?

Thanks,
 -- rik

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-06-14