cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Strange: libbcurl too standards compliant

From: Cris Bailiff <c.bailiff_at_awayweb.com>
Date: Mon, 03 Sep 2001 10:46:23 +1000

Daniel Stenberg wrote:
>
> On Fri, 31 Aug 2001, Cris Bailiff wrote:

> > (I get a '500' status from libcurl, and the same status text)
>
> I don't understand, what's the '500' status you get?

Sorry, I described the error without checking my code - my app has
something like " if curl_status <> 0 then http_error_code=500 ", so that
curl failures are reported to the user like any other http error.
libcurl just says " curl_status<>0 : of course.

> I think this calls for something to get changed in the library. I don't think
> the right decision would be to just convert this error into an informational
> message, as there might be applications/people who actually want to know
> about this situation, and it _is_ an HTTP "error". Or would it?

Well, I just do this anyway, in the app. (Actually, LWP does the same,
making up its own 500 errors on most failures). Its handy for me, as I'm
just passing the error text back to a user, but if I was doing a
non-user based app, I'd prefer the real status mechanism...
 
> I wonder if we could come up with some kind of system to turn optional
> "problems" or "violations" into mere informationals...? Like
> curl_allow_protocol_abuse_if_you_can_continue_anyway() ?

A nice idea - I guess the 'error' function could fake up a whole 500
reply depending on the switch, though its tricky to call all the correct
file and callback hooks after that. In fact, it might be easier to have
it as a curl feature, rather than a library feature - it seemed easy
enough to do this for myself in my app, and get the specific format that
I wanted.

> > I could probably fudge my app to look for 302 status and ignore the
> > failure (I think libcurl lets me see the real status, despite the
> > failure, didn't look yet)
>
> It should.

I did, and it did. I just added a line before my other check: " if
curl_status != 0 and http_error_code=302 then curl_status = 0 " :-)
 
> > is it an issue that libcurl should/could address, for maximum
> > compatibility with 'standard' (broken) http clients?
>
> Yes of course. The question is only how we control it.

Well, of course, I'm solved now, but perhaps its a curl feature rather
than a libcurl feature?

Cris
Received on 2001-09-03