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

curl-and-php

Slow cURL Posts, but browser posts fine

From: Matt Babineau <matt_at_criticalcode.com>
Date: Mon, 14 Apr 2003 19:42:04 -0400

I am having long retrival time problems, typically upward of 10 seconds or
so says the total_time debug statement. Sometimes however it is as low as 2
seconds. I am posting to a secure payment gateway and pulling back the html
results. It just seems to me that this process should be a whole lot faster
then it is. I am using the version of cURL that comes with PHP 4.2.3 for
windows.

When I do the same exact thing with my web browser, its post and returns
very quickly! I dont understand the problem, and I need to make this
ecommerce web site live.

I am running cURL 7.9.8.

I've tried searching google extensively, without much luck.

I really need to find an answer to this long post and frequent non-retrieval
problem.

========= CODE =============

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, " <https://paymentgateway/>
https://paymentgateway");
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 20); //times out after 4s
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01;
Windows NT 5.0)");
curl_setopt($ch, CURLOPT_REFERER, " <https://clientsite/>
https://clientsite);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $strPost);
$result = curl_exec($ch);
/*
echo "<BR><BR>";
print_r(curl_getinfo($ch));
echo "<br><br>cURL error number: " .curl_errno($ch);
echo "<br><br>cURL error: " . curl_error($ch);
echo "<BR><BR>";
*/
curl_close ($ch);
==============================

Is it possible to speed up this process??

Thanks!

Matt Babineau
www.criticalcode.com
e:: <mailto:matt_at_criticalcode.com> matt_at_criticalcode.com p:: 603.943.4237

 

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-04-15