Gaetano Giunta | 4 Jul 11:01 2005
Picon

2 questions: keep-alives and http compression

Sorry if these questions have been answered already on the mailing list: I had trouble findind precise and
definitive answers:

1 - keep-alives:
is it possible to send multiple http requests from PHP-curl without closing the socket to the HTTP server?
If so, how can it be enabled/disabled?

2 - compression: does the support for CURL receiving compressed data does depend upon compile-time
options (ie explicit linking with zlib vs. php linking with zlib)? what happens if curl is compiled
without that support and the PHP coder sets CURLOPT_ENCODING to 'gzip'? will curl send the gzip header to
the sender and then pass un-decompressed data back to PHP?

Thanks
Gaetano

Daniel Stenberg | 4 Jul 14:06 2005
Picon

Re: 2 questions: keep-alives and http compression

On Mon, 4 Jul 2005, Gaetano Giunta wrote:

> 1 - keep-alives: is it possible to send multiple http requests from PHP-curl 
> without closing the socket to the HTTP server? If so, how can it be 
> enabled/disabled?

http://curl.haxx.se/docs/faq.html#7.3

You disable that ability in libcurl by closing the handle after the transfer, 
without reusing it.

> 2 - compression: does the support for CURL receiving compressed data does 
> depend upon compile-time options (ie explicit linking with zlib vs. php 
> linking with zlib)?

PHP/CURL is just a glue layer on top of libcurl. All transfer and socket 
related stuff is made by libcurl and thus your libcurl must have been built 
with zlib support.

> what happens if curl is compiled without that support and the PHP coder sets 
> CURLOPT_ENCODING to 'gzip'? will curl send the gzip header to the sender and 
> then pass un-decompressed data back to PHP?

Yes. You are supposed to pass a "" to libcurl if you want to enable the 
compression(s) libcurl supports. This is documented in the libcurl docs.

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

(Continue reading)

Gaetano Giunta | 5 Jul 14:48 2005
Picon

RE: curl-and-php Digest, Vol 18, Issue 2

Thanks for the quick and precise answers (as always).

The keep-alive feature is most interesting to me, and I have a few more questions about that: what will
happen if I reuse the same CURL handle to operate a second POST but change in the meantime the values set to
these options:
- CURLOPT_USERPWD
- CURLOPT_SSLCERT
- CURLOPT_SSLCERTPASSWD
- CURLOPT_SSL_VERIFYPEER
- CURLOPT_SSL_VERIFYHOST
- CURLOPT_PROXY
- CURLOPT_PROXYUSERPWD

will the lib automatically take care of that?

Bye
Gaetano

> Date: Mon, 4 Jul 2005 14:06:33 +0200 (CEST)
> From: Daniel Stenberg <daniel-curl <at> haxx.se>
> Subject: Re: 2 questions: keep-alives and http compression
> To: Programming PHP/CURL <curl-and-php <at> cool.haxx.se>
> Message-ID: <Pine.LNX.4.63.0507041113470.17471 <at> yvahk3.pbagnpgbe.fr>
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
> 
> On Mon, 4 Jul 2005, Gaetano Giunta wrote:
> 
> > 1 - keep-alives: is it possible to send multiple http 
> requests from PHP-curl 
> > without closing the socket to the HTTP server? If so, how can it be 
(Continue reading)

Daniel Stenberg | 5 Jul 15:08 2005
Picon

Re-use and changed settings (was RE: curl-and-php Digest, Vol 18, Issue 2)

On Tue, 5 Jul 2005, Gaetano Giunta wrote:

Please use sensible subjects in mails posted here.

> The keep-alive feature is most interesting to me, and I have a few more 
> questions about that: what will happen if I reuse the same CURL handle to 
> operate a second POST but change in the meantime the values set to these 
> options:

> - CURLOPT_USERPWD
> - CURLOPT_SSLCERT
> - CURLOPT_SSLCERTPASSWD
> - CURLOPT_SSL_VERIFYPEER
> - CURLOPT_SSL_VERIFYHOST
> - CURLOPT_PROXY
> - CURLOPT_PROXYUSERPWD
>
> will the lib automatically take care of that?

I suggest you take libcurl questions to the curl-library mailing list in the 
future. I am only reading this list sporadically.

But yes, libcurl is supposed to take all options into account that may affect 
how connections can be re-used. If not, it bugs.

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Jonathan Bartlett | 6 Jul 14:47 2005

Upgrading Curl

I just upgraded curl from 7.9.8 to 7.14.0.  This upgraded the .so 
version from .so.2 to .so.3.  However, I have several programs linked 
against .so.2 that I don't want to recompile.  I deleted .so.2 and 
symlinked it to .so.3.  So far its working.  Does anyone know what 
binary incompatibilities, if any, exist from .so.2 to .so.3?  It seems 
to be working now but I want to know what to watch out for.

Jon
----
Learn to program using Linux assembly language
http://www.cafeshops.com/bartlettpublish.8640017

Jon Aston | 11 Jul 20:35 2005
Picon

java session problem or?

I have minimal experience with cURL but have had some success with it.
 
I am running a new cURL session for each page but have the cookiefile and jar set to the same location for all sessions.  normally that works fine for me.  s this the way that I should do this or should I not call curl_close($ch).  Is it possible to continue to execute page requests and posts and such on the same connection?  if so does it request the entire string that you have requested multiple times?  for example if I do not close the connection when I request page 4 will it get page 1, post page 2, and post page three and then get 4 or is it like leaving the browser open and going to the next page so all it gets is page 4? 

I am trying to download some invoices that are posted every month.  I am
able to get a login to the https: and get the first few pages but when I try
to get the invoices I get an error page with this content.
HTTP Status 500 -
----------------------------------------------------------------------------
----
type Exception report
message
description The server encountered an internal error () that prevented it
from fulfilling this request.
exception
java.lang.NullPointerException
 .........
39 lines of error messages

Everything seems to work fine up to the point that I am given a jsessionID
on the third page that is curled.  It seems to be writing the info to the
cookie file but I don't know if I am handling it incorrectly or if that has
anything to do with it.

I have downloaded LiveHTTPHeaders version 0.10 available here
http://livehttpheaders.mozdev.org/index.html to see if I was missing any of
the information that has been passed and having compared the log file I can
say that I am passing the same information as the mozilla browser.  does
anyone have any suggestions.

and an RTFM is fine but I have been over several of the links posted
http://curl.haxx.se/docs/ so if you tell me RTFM please send my idiot self
to the correct page.
Daniel Stenberg | 13 Jul 09:21 2005
Picon

Stricter posting policy coming up

Hi friends, (cross-posting)

I'm a bit disturbed to have to resort to this, but I feel I have no choice.

Starting very soon, all posts to this mailing list[*] from non-subscribers 
will be rejected mercilessly. There will be no more "acknowledging" 
unauthorized mails by mailing list admins like we've done for many years.

If you want to post to a curl-related mailing list (hosted by haxx.se), you 
will HAVE TO subscribe first then post.

The reason for this is quite simply that I no longer want the burden of having 
to clear spam from the admin queues at the rate of tens of spam to each list 
every day. Unfortunately, this means that the evildoers once again makes it 
slighty harder for newbies and "casual posters". On the positive side, it'll 
make me a happier man and it will give me many more minutes spare time every 
day that I previously spent clicking in mailman's web interface...

Yes, I know there are many spam filtering techniques and options available, 
but for the moment the subcribers-only is the absolutely best policy that is 
next to foolproof.

I personally get spam at the rate of no less than 400 per day for the moment, 
with peak days reaching up to and beyond 5000. Of course the vast majority of 
them are just filtered away and discarded without me ever seeing them. Please 
notice this in case you mail me privately, since in my constant chase at 
reducing the flood I use very strict rules and filters that possibly may 
discard one or two legitimate mails at times.

Just another reason to keep curl-related mail on the curl-related mailing 
lists!

[*] = curl-users, curl-library, curl-and-php and curl-and-python and
       future curl-related mailing lists hosted or maintained by me/haxx.se.

--

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html

Melino Angelina | 17 Jul 20:29 2005
Picon

Getting screen content with CURL

Hello,
after tring a lot i ask myself:
is there a way to get the screen content of an url with CURL
i say screen content not source
Regards
ZS

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

Norman E. Avila G. | 19 Jul 00:47 2005
Picon

Do not wait after a curl post to a site.

Hi. I am a volunteer to the Guatemala Red Cross, we want to use our personal cellphones to be advise of any situation easier and faster.
I worked in a small webform that curl-post to the different Cellphone carriers to send a SMS, currently there are 60 phones on the list, I see that the response is aprox. 5 minutes, after the submit.

How can i make libcurl to ignore to wait and do the post for the next phone in list? in order to have a faster response from the submit form...? right now this is what I have...

(for 2 different carriers)

//Telefónica
$curlPost    = 'to='  . urlencode($phoneNumber) . '&subject=' . urlencode($from) . '&text=' . urlencode($message) . '&submit=Enviar';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://216.184.96.114/sms/mensaje.php');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
curl_exec ($ch);
curl_close ($ch);

//PCS
$curlPost    = 'telefono='  . urlencode($phoneNumber) . '&nombre=' . urlencode($from) . '&msg=' . urlencode($message) . '&B1=E n v i a r&B2=B o r r a r';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://was.intelnet.net.gt/cgi-bin/sms.cgi');
curl_setopt($ch, CURLOPT_REFERER, 'http://www.pcsdigital.com.gt/mensajes.html');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
curl_exec ($ch);
curl_close ($ch);



Thanks

Kirk Hedden | 19 Jul 15:26 2005

Re: Do not wait after a curl post to a site.

There's not a way to do this, as far as I know.

If you don't care about responses, you can just open a raw socket and send the data you need. Of course, this might not solve the issue if the server is the bottleneck.

Alternatively, you may also want to contact your carriers and see if they have some kind of better system for submitting text messages for automated systems like yours.

Kirk

At 06:47 PM 7/18/2005, you wrote:
Hi. I am a volunteer to the Guatemala Red Cross, we want to use our personal cellphones to be advise of any situation easier and faster.
I worked in a small webform that curl-post to the different Cellphone carriers to send a SMS, currently there are 60 phones on the list, I see that the response is aprox. 5 minutes, after the submit.

How can i make libcurl to ignore to wait and do the post for the next phone in list? in order to have a faster response from the submit form...? right now this is what I have...

(for 2 different carriers)

//Telefónica
$curlPost    = 'to='  . urlencode($phoneNumber) . '&subject=' . urlencode($from) . '&text=' . urlencode($message) . '&submit=Enviar';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://216.184.96.114/sms/mensaje.php');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
curl_exec ($ch);
curl_close ($ch);

//PCS
$curlPost    = 'telefono='  . urlencode($phoneNumber) . '&nombre=' . urlencode($from) . '&msg=' . urlencode($message) . '&B1=E n v i a r&B2=B o r r a r';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://was.intelnet.net.gt/cgi-bin/sms.cgi');
curl_setopt($ch, CURLOPT_REFERER, 'http://www.pcsdigital.com.gt/mensajes.html');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
curl_exec ($ch);
curl_close ($ch);



Thanks

Gmane