Edit report at http://bugs.php.net/bug.php?id=53392&edit=1

 ID:                 53392
 User updated by:    martin dot k at atlas dot cz
 Reported by:        martin dot k at atlas dot cz
 Summary:            curl_getcontent
 Status:             Open
 Type:               Feature/Change Request
 Package:            cURL related
 PHP Version:        5.3.3
 Block user comment: N
 Private report:     N

 New Comment:

Yes, I can! But if I use curl multi functions, I can also use write
function to save the partial content. So why is there
curl_multi_getcontent function?



Moreover, it's very difficult to use write function (I must create new
function, set up it for callback, manualy handle and store written
data).



Same for case, when I can initialize curl_multi and use it only for
download 1 file (I must call curl_init, curl_multi_init,
curl_multi_add_handle then call curl_multi_exec in do-while cycle and
more..)



In both of these case, the source code lost its brilliant simplicity
:-(



As I wrote, there is no SIMPLE way how to do that. And if is requested
function already implemented for multi curl, it should be easy make it
for single curl.



The getcontent functions are not vital functions for cURL. As you said,
everybody can use write function to save the partial content - this
applies to single curl and also for multi curl!



I really don't understand, why is function implemented only for multi
curl and not for single curl? Why to want make easy life only for multi
curl and no for single curl? For both case of use, there is "ugly"
alternative way (write function) to solve problem. And there should be
great function getcontent also for both, not only for one...


Previous Comments:
------------------------------------------------------------------------
[2010-11-27 21:16:47] [email protected]

Well, you can use a write function to save the partial content.

------------------------------------------------------------------------
[2010-11-23 22:56:15] martin dot k at atlas dot cz

Description:
------------
Please add function curl_getcontent similar to curl_multi_getcontent.
Why?



When I call function curl_exec with set CURLOPT_TIMEOUT and timeout
happend. It will return false and I have bad luck :-(



However when I call function curl_multi_exec also with set
CURLOPT_TIMEOUT and timeout happend. It will return false as well, but
then I can call function curl_multi_getcontent and get partial content
of downloaded file :-)



Bottom line,

there is no simple way how to get content (including header & body) if
function curl_exec ends up with fail. But if function curl_multi_exec
will fail, I can call function curl_multi_getcontent and try get a part
of content at least. Which can be useful!



------------------------------------------------------------------------



-- 
Edit this bug report at http://bugs.php.net/bug.php?id=53392&edit=1

Reply via email to