php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50717 Slow download speed
Submitted: 2010-01-10 18:14 UTC Modified: 2010-01-19 15:44 UTC
From: abaddon_a2006 at yahoo dot com Assigned:
Status: Not a bug Package: cURL related
PHP Version: 5.3.1 OS: fedora 12
Private report: No CVE-ID: None
 [2010-01-10 18:14 UTC] abaddon_a2006 at yahoo dot com
Description:
------------
If you use cURL to login and store a cookie with CURLOPT_COOKIEJAR, "cookie"); and later retrieve the cookie with CURLOPT_COOKIEFILE the download speed is very low i dont know why this is happening but it's happening.
tested without cookie download speed is normal,but with cookie is somewhere around 7KB maximum



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-01-10 22:35 UTC] jani@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with <?php and ends with ?>,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.


 [2010-01-11 16:02 UTC] abaddon_a2006 at yahoo dot com
here it is a code that reproduce the problem

$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, "name");
curl_setopt($ch, CURLOPT_URL,"http://url/login.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'user=username&password=pass');

ob_start();      // prevent any output
curl_exec ($ch); // execute the curl command
ob_end_clean();  // stop preventing output

curl_close ($ch);
unset($ch);

$opt = array(
CURLOPT_RETURNTRANSFER => 1, 
CURLOPT_COOKIEFILE => "name", 
CURLOPT_USERAGENT => "Mozilla/5.001 (windows; U; NT4.0; en-US; rv:1.0) Gecko/25250101",
CURLOPT_PORT => "80"
);
if i submit this code everything is ok
0.21246290206909 seconds this is the time response but if i add this under it

   $ch = curl_init();
   curl_setopt($ch, CURLOPT_URL, 'http://url');
   curl_setopt_array($ch,$opt);
   $content = curl_exec($ch);
   print_r(curl_getinfo($ch));
   curl_close($ch); 

here is what it does return and it's weird yesterday i had no problem with namelookup_time and today it does seem that it's unable to calculate it... 

Array ( [url] => http://url [content_type] => text/html; charset=utf-8 [http_code] => 200 [header_size] => 244 [request_size] => 227 [filetime] => -1 [ssl_verify_result] => 0 [redirect_count] => 0 [total_time] => 5.878797 [namelookup_time] => 2.6E-5 [connect_time] => 0.06947 [pretransfer_time] => 0.069475 [size_upload] => 0 [size_download] => 19463 [speed_download] => 3310 [speed_upload] => 0 [download_content_length] => -1 [upload_content_length] => 0 [starttransfer_time] => 5.74344 [redirect_time] => 0 ) This page was created in 6.0242450237274 seconds

hope this will be fixed soon thank you
 [2010-01-12 10:19 UTC] jani@php.net
What curl version have you compiled PHP with?
 [2010-01-12 10:59 UTC] abaddon_a2006 at yahoo dot com
curl 7.19.7 (i386-redhat-linux-gnu) libcurl/7.19.7 NSS/3.12.4.5 zlib/1.2.3 libidn/1.9 libssh2/1.2
Protocols: tftp ftp telnet dict ldap ldaps http file https ftps scp sftp
Features: GSS-Negotiate IDN IPv6 Largefile SSL libz
 [2010-01-14 21:46 UTC] rasmus@php.net
I doubt this is a PHP issue, if it even is an issue at all.  From the 
PHP side there is no difference between a request with a cookie and one 
without.  That's all inside libcurl.  Try emulating the same thing from 
the command-line curl client with and without a cookie jar and see if 
you see the same effect.  I predict you will.
 [2010-01-19 12:35 UTC] abaddon_a2006 at yahoo dot com
after a curl update everything work smoothly :)
thank you for your help
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Fri Oct 18 06:01:27 2019 UTC