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

curl-and-php

Re: Server memory usage

From: Leonardo <leobasilio_at_gmail.com>
Date: Sat, 7 Feb 2009 23:49:57 -0200

Ending the buffer didn't work. Actually, there was no need of buffer
management using php at all. The code behavior was the same whether I used
it or not. The server report shows that apache is the one consuming memory,
not php. That's what I discuss in my reply to Daniel. Thanks for your help,
haroon.

2009/2/7, Leonardo <leobasilio_at_gmail.com>:
>
> The length of $data must be returned by the function, according to the
> manual:
>
> http://br.php.net/manual/en/function.curl-setopt.php
>
> *CURLOPT_WRITEFUNCTION
>
> * "The name of a callback function where the callback function takes two
> parameters. The first is the cURL resource, and the second is a string with
> the data to be written. The data must be written by using this callback
> function. Must return the exact number of bytes written or this will fail."
>
> I'll try to end the buffer tomorrow. It's almost 1 am here. I'll let you
> know if it works.
>
> Thank you.
>
> 2009/2/7 haroon ahmad <haroon_at_fastcreators.com>
>
>> try this
>>
>> function foo($c, $data){
>> ob_start(); // start buffering
>> $data=ob_get_contents(); //store buffer data in variable
>> ob_end_clean();
>>
>> print $data // I didn't get your idea of returning string size of $data
>> // does whatever it does
>>
>> // return strlen($data);
>>
>> }
>>
>> Regards,
>> Haroon Ahmad
>> www.haroonahmad.co.uk
>> PHP Developer U.K
>>
>> _______________________________________________
>> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>>
>>
>

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2009-02-08