cURL / Mailing Lists / curl-library / Single Mail

curl-library

Aborting downloads based on headers?

From: Michael Mastroianni <MMastroianni_at_choicestream.com>
Date: Fri, 20 May 2005 18:34:35 -0400

This is probably a stupid question, but here goes. I have a sort of
spider that uses libcurl to download stuff (in a massively multithreaded
way, which works very well, my compliments to you guys), but now I'm in
a situation where I want to reject everything that has a content-type
other than text/html or text/plain

(I'm using the easy interface, btw). I have callback fns for getting the
headers into a vector of strings and getting the content into an stl
string.

Right now, I'm simply calling curl_easy_perform, and then going through
the
Headers and emptying the content of any item which has the wrong
content-type.

This is clearly not the way to do this, but I don't see any sensible way
of interrupting the download without hacking into curl itself.

Anyway, I'm sure there is a sensible way to do this. Can anyone suggest
how?
Received on 2005-05-21