Req #53392 [Opn->Csd]: curl_getcontent

From: Date: Fri, 04 Dec 2020 17:45:41 +0000
Subject: Req #53392 [Opn->Csd]: curl_getcontent
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-230864@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=53392&edit=1

 ID:                 53392
 Updated by:         cmb@php.net
 Reported by:        martin dot k at atlas dot cz
 Summary:            curl_getcontent
-Status:             Open
+Status:             Closed
 Type:               Feature/Change Request
 Package:            cURL related
 PHP Version:        5.3.3
-Assigned To:        
+Assigned To:        cmb
 Block user comment: N
 Private report:     N

 New Comment:

curl_multi_getcontent() is a misnomer; actually, the function has
nothing to do with cURL multi handles, but works on vanilla cURL
handles.  As such there is nothing to add.


Previous Comments:
------------------------------------------------------------------------
[2010-11-27 23:29:28] martin dot k at atlas dot cz

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...

------------------------------------------------------------------------
[2010-11-27 21:16:47] cataphract@php.net

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 https://bugs.php.net/bug.php?id=53392&edit=1


Thread (4 messages)

« previous php.bugs (#230864) next »