cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

RE: question: ssl through proxies

From: Gaetano Giunta <giunta.gaetano_at_sea-aeroportimilano.it>
Date: Wed, 13 Sep 2006 14:16:36 +0200

> On Tue, 5 Sep 2006, Gaetano Giunta wrote:
>
> > if there is a better way in curl-php to have curl feed the
> http headers to
> > my app, it would be a welcome enhancement...
>
> You can setup a header callback.
>

Thanks, that possibility had escaped me up to now (the list of options for curl_setopt() is really daunting, and new options pop up every now and then without proper notice).

I think I am going to implement this asap, even though I strive to maintain compatibility with php 5.0.5, which does not support header callback...

> ...
>
> > Afaict looking for a particular reason-phrase is dead wrong, but then how am
> > I supposed to know I should expect two seaparate sets of HTTP 200 status
> > lines? Maybe I would be better off only/always doing this check when using
> > proxy AND https?
>
> CONNECT is a request, a request gets response-headers back.
> CONNECT is in
> libcurl's case always followed by a request to the server that it has
> "tunneled" through to. That request too gets response-headers back.
>
> So, if you do a CONNECT expect headers back as a response to
> that. If you do
> another reqest, expect headers back from that. If you do a
> POST or PUT with
> Expect: 100-continue, expect possibly two sets of headers back.

Yes, but I am not doing an explicit CONNECT right now: I only set up the appropriate ssl and proxy options, and leave cURL to do the dirty work. Hence my inability to expect two sets of response headers.

I think that the best solution is the one mentioned above: let curl do the heavy lifting, and make it easier for my app to receive separate sets of response headers and payload.

Thanks
Gaetano Giunta

PS: in case I set up a response haeder handling function, how will curl behave with regards to a) multi-line headers, and b) headers that are repeated multiple times in the response even though they should not, such as e.g. content-length?

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-09-13