1 /*
2 +----------------------------------------------------------------------+
3 | Copyright (c) The PHP Group |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.01 of the PHP license, |
6 | that is bundled with this package in the file LICENSE, and is |
7 | available through the world-wide-web at the following url: |
8 | https://www.php.net/license/3_01.txt |
9 | If you did not receive a copy of the PHP license and are unable to |
10 | obtain it through the world-wide-web, please send a note to |
11 | license@php.net so we can mail you a copy immediately. |
12 +----------------------------------------------------------------------+
13 | Author: Sterling Hughes <sterling@php.net> |
14 +----------------------------------------------------------------------+
15 */
16
17 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
18
19 #ifdef HAVE_CONFIG_H
20 #include "config.h"
21 #endif
22
23 #include "php.h"
24 #include "Zend/zend_smart_str.h"
25
26 #include "curl_private.h"
27
28 #include <curl/curl.h>
29 #include <curl/multi.h>
30
31 #ifdef HAVE_SYS_SELECT_H
32 #include <sys/select.h>
33 #endif
34
35 #ifdef HAVE_SYS_TIME_H
36 #include <sys/time.h>
37 #endif
38
39 #ifdef HAVE_SYS_TYPES_H
40 #include <sys/types.h>
41 #endif
42
43 #ifdef HAVE_UNISTD_H
44 #include <unistd.h>
45 #endif
46
47 #define SAVE_CURLM_ERROR(__handle, __err) (__handle)->err.no = (int) __err;
48
49 /* CurlMultiHandle class */
50
51 zend_class_entry *curl_multi_ce;
52
curl_multi_from_obj(zend_object * obj)53 static inline php_curlm *curl_multi_from_obj(zend_object *obj) {
54 return (php_curlm *)((char *)(obj) - XtOffsetOf(php_curlm, std));
55 }
56
57 #define Z_CURL_MULTI_P(zv) curl_multi_from_obj(Z_OBJ_P(zv))
58
59 /* {{{ Returns a new cURL multi handle */
PHP_FUNCTION(curl_multi_init)60 PHP_FUNCTION(curl_multi_init)
61 {
62 php_curlm *mh;
63 CURLM *multi;
64
65 ZEND_PARSE_PARAMETERS_NONE();
66 multi = curl_multi_init();
67 if (UNEXPECTED(multi == NULL)) {
68 zend_throw_error(NULL, "%s(): Could not initialize a new cURL multi handle", get_active_function_name());
69 RETURN_THROWS();
70 }
71 object_init_ex(return_value, curl_multi_ce);
72 mh = Z_CURL_MULTI_P(return_value);
73 mh->multi = multi;
74
75 zend_llist_init(&mh->easyh, sizeof(zval), _php_curl_multi_cleanup_list, 0);
76 }
77 /* }}} */
78
79 /* {{{ Add a normal cURL handle to a cURL multi handle */
PHP_FUNCTION(curl_multi_add_handle)80 PHP_FUNCTION(curl_multi_add_handle)
81 {
82 zval *z_mh;
83 zval *z_ch;
84 php_curlm *mh;
85 php_curl *ch;
86 CURLMcode error = CURLM_OK;
87
88 ZEND_PARSE_PARAMETERS_START(2,2)
89 Z_PARAM_OBJECT_OF_CLASS(z_mh, curl_multi_ce)
90 Z_PARAM_OBJECT_OF_CLASS(z_ch, curl_ce)
91 ZEND_PARSE_PARAMETERS_END();
92
93 mh = Z_CURL_MULTI_P(z_mh);
94 ch = Z_CURL_P(z_ch);
95
96 _php_curl_verify_handlers(ch, /* reporterror */ true);
97
98 _php_curl_cleanup_handle(ch);
99
100 Z_ADDREF_P(z_ch);
101 zend_llist_add_element(&mh->easyh, z_ch);
102
103 error = curl_multi_add_handle(mh->multi, ch->cp);
104 SAVE_CURLM_ERROR(mh, error);
105
106 RETURN_LONG((zend_long) error);
107 }
108 /* }}} */
109
_php_curl_multi_cleanup_list(void * data)110 void _php_curl_multi_cleanup_list(void *data) /* {{{ */
111 {
112 zval *z_ch = (zval *)data;
113
114 zval_ptr_dtor(z_ch);
115 }
116 /* }}} */
117
118 /* Used internally as comparison routine passed to zend_list_del_element */
curl_compare_objects(zval * z1,zval * z2)119 static int curl_compare_objects( zval *z1, zval *z2 ) /* {{{ */
120 {
121 return (Z_TYPE_P(z1) == Z_TYPE_P(z2) &&
122 Z_TYPE_P(z1) == IS_OBJECT &&
123 Z_OBJ_P(z1) == Z_OBJ_P(z2));
124 }
125 /* }}} */
126
127 /* Used to find the php_curl resource for a given curl easy handle */
_php_curl_multi_find_easy_handle(php_curlm * mh,CURL * easy)128 static zval *_php_curl_multi_find_easy_handle(php_curlm *mh, CURL *easy) /* {{{ */
129 {
130 php_curl *tmp_ch;
131 zend_llist_position pos;
132 zval *pz_ch_temp;
133
134 for(pz_ch_temp = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch_temp;
135 pz_ch_temp = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
136 tmp_ch = Z_CURL_P(pz_ch_temp);
137
138 if (tmp_ch->cp == easy) {
139 return pz_ch_temp;
140 }
141 }
142
143 return NULL;
144 }
145 /* }}} */
146
147 /* {{{ Remove a multi handle from a set of cURL handles */
PHP_FUNCTION(curl_multi_remove_handle)148 PHP_FUNCTION(curl_multi_remove_handle)
149 {
150 zval *z_mh;
151 zval *z_ch;
152 php_curlm *mh;
153 php_curl *ch;
154 CURLMcode error = CURLM_OK;
155
156 ZEND_PARSE_PARAMETERS_START(2,2)
157 Z_PARAM_OBJECT_OF_CLASS(z_mh, curl_multi_ce)
158 Z_PARAM_OBJECT_OF_CLASS(z_ch, curl_ce)
159 ZEND_PARSE_PARAMETERS_END();
160
161 mh = Z_CURL_MULTI_P(z_mh);
162 ch = Z_CURL_P(z_ch);
163
164 error = curl_multi_remove_handle(mh->multi, ch->cp);
165 SAVE_CURLM_ERROR(mh, error);
166
167 RETVAL_LONG((zend_long) error);
168 zend_llist_del_element(&mh->easyh, z_ch, (int (*)(void *, void *))curl_compare_objects);
169
170 }
171 /* }}} */
172
173 /* {{{ Get all the sockets associated with the cURL extension, which can then be "selected" */
PHP_FUNCTION(curl_multi_select)174 PHP_FUNCTION(curl_multi_select)
175 {
176 zval *z_mh;
177 php_curlm *mh;
178 double timeout = 1.0;
179 int numfds = 0;
180 CURLMcode error = CURLM_OK;
181
182 ZEND_PARSE_PARAMETERS_START(1,2)
183 Z_PARAM_OBJECT_OF_CLASS(z_mh, curl_multi_ce)
184 Z_PARAM_OPTIONAL
185 Z_PARAM_DOUBLE(timeout)
186 ZEND_PARSE_PARAMETERS_END();
187
188 mh = Z_CURL_MULTI_P(z_mh);
189
190 if (!(timeout >= 0.0 && timeout <= ((double)INT_MAX / 1000.0))) {
191 php_error_docref(NULL, E_WARNING, "timeout must be between 0 and %d", (int)ceilf((double)INT_MAX / 1000));
192 #ifdef CURLM_BAD_FUNCTION_ARGUMENT
193 SAVE_CURLM_ERROR(mh, CURLM_BAD_FUNCTION_ARGUMENT);
194 #endif
195 RETURN_LONG(-1);
196 }
197
198 error = curl_multi_wait(mh->multi, NULL, 0, (int) (timeout * 1000.0), &numfds);
199 if (CURLM_OK != error) {
200 SAVE_CURLM_ERROR(mh, error);
201 RETURN_LONG(-1);
202 }
203
204 RETURN_LONG(numfds);
205 }
206 /* }}} */
207
208 /* {{{ Run the sub-connections of the current cURL handle */
PHP_FUNCTION(curl_multi_exec)209 PHP_FUNCTION(curl_multi_exec)
210 {
211 zval *z_mh;
212 zval *z_still_running;
213 php_curlm *mh;
214 int still_running;
215 CURLMcode error = CURLM_OK;
216
217 ZEND_PARSE_PARAMETERS_START(2, 2)
218 Z_PARAM_OBJECT_OF_CLASS(z_mh, curl_multi_ce)
219 Z_PARAM_ZVAL(z_still_running)
220 ZEND_PARSE_PARAMETERS_END();
221
222 mh = Z_CURL_MULTI_P(z_mh);
223
224 {
225 zend_llist_position pos;
226 php_curl *ch;
227 zval *pz_ch;
228
229 for (pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch;
230 pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
231 ch = Z_CURL_P(pz_ch);
232
233 _php_curl_verify_handlers(ch, /* reporterror */ true);
234 }
235 }
236
237 still_running = zval_get_long(z_still_running);
238 error = curl_multi_perform(mh->multi, &still_running);
239 ZEND_TRY_ASSIGN_REF_LONG(z_still_running, still_running);
240
241 SAVE_CURLM_ERROR(mh, error);
242 RETURN_LONG((zend_long) error);
243 }
244 /* }}} */
245
246 /* {{{ Return the content of a cURL handle if CURLOPT_RETURNTRANSFER is set */
PHP_FUNCTION(curl_multi_getcontent)247 PHP_FUNCTION(curl_multi_getcontent)
248 {
249 zval *z_ch;
250 php_curl *ch;
251
252 ZEND_PARSE_PARAMETERS_START(1, 1)
253 Z_PARAM_OBJECT_OF_CLASS(z_ch, curl_ce)
254 ZEND_PARSE_PARAMETERS_END();
255
256 ch = Z_CURL_P(z_ch);
257
258 if (ch->handlers.write->method == PHP_CURL_RETURN) {
259 if (!ch->handlers.write->buf.s) {
260 RETURN_EMPTY_STRING();
261 }
262 smart_str_0(&ch->handlers.write->buf);
263 RETURN_STR_COPY(ch->handlers.write->buf.s);
264 }
265
266 RETURN_NULL();
267 }
268 /* }}} */
269
270 /* {{{ Get information about the current transfers */
PHP_FUNCTION(curl_multi_info_read)271 PHP_FUNCTION(curl_multi_info_read)
272 {
273 zval *z_mh;
274 php_curlm *mh;
275 CURLMsg *tmp_msg;
276 int queued_msgs;
277 zval *zmsgs_in_queue = NULL;
278 php_curl *ch;
279
280 ZEND_PARSE_PARAMETERS_START(1, 2)
281 Z_PARAM_OBJECT_OF_CLASS(z_mh, curl_multi_ce)
282 Z_PARAM_OPTIONAL
283 Z_PARAM_ZVAL(zmsgs_in_queue)
284 ZEND_PARSE_PARAMETERS_END();
285
286 mh = Z_CURL_MULTI_P(z_mh);
287
288 tmp_msg = curl_multi_info_read(mh->multi, &queued_msgs);
289 if (tmp_msg == NULL) {
290 RETURN_FALSE;
291 }
292
293 if (zmsgs_in_queue) {
294 ZEND_TRY_ASSIGN_REF_LONG(zmsgs_in_queue, queued_msgs);
295 }
296
297 array_init(return_value);
298 add_assoc_long(return_value, "msg", tmp_msg->msg);
299 add_assoc_long(return_value, "result", tmp_msg->data.result);
300
301 /* find the original easy curl handle */
302 {
303 zval *pz_ch = _php_curl_multi_find_easy_handle(mh, tmp_msg->easy_handle);
304 if (pz_ch != NULL) {
305 /* we must save result to be able to read error message */
306 ch = Z_CURL_P(pz_ch);
307 SAVE_CURL_ERROR(ch, tmp_msg->data.result);
308
309 Z_ADDREF_P(pz_ch);
310 add_assoc_zval(return_value, "handle", pz_ch);
311 }
312 }
313 }
314 /* }}} */
315
316 /* {{{ Close a set of cURL handles */
PHP_FUNCTION(curl_multi_close)317 PHP_FUNCTION(curl_multi_close)
318 {
319 php_curlm *mh;
320 zval *z_mh;
321
322 zend_llist_position pos;
323 zval *pz_ch;
324
325 ZEND_PARSE_PARAMETERS_START(1,1)
326 Z_PARAM_OBJECT_OF_CLASS(z_mh, curl_multi_ce)
327 ZEND_PARSE_PARAMETERS_END();
328
329 mh = Z_CURL_MULTI_P(z_mh);
330
331 for (pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch;
332 pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
333 php_curl *ch = Z_CURL_P(pz_ch);
334 _php_curl_verify_handlers(ch, /* reporterror */ true);
335 curl_multi_remove_handle(mh->multi, ch->cp);
336 }
337 zend_llist_clean(&mh->easyh);
338 }
339 /* }}} */
340
341 /* {{{ Return an integer containing the last multi curl error number */
PHP_FUNCTION(curl_multi_errno)342 PHP_FUNCTION(curl_multi_errno)
343 {
344 zval *z_mh;
345 php_curlm *mh;
346
347 ZEND_PARSE_PARAMETERS_START(1,1)
348 Z_PARAM_OBJECT_OF_CLASS(z_mh, curl_multi_ce)
349 ZEND_PARSE_PARAMETERS_END();
350
351 mh = Z_CURL_MULTI_P(z_mh);
352
353 RETURN_LONG(mh->err.no);
354 }
355 /* }}} */
356
357 /* {{{ return string describing error code */
PHP_FUNCTION(curl_multi_strerror)358 PHP_FUNCTION(curl_multi_strerror)
359 {
360 zend_long code;
361 const char *str;
362
363 ZEND_PARSE_PARAMETERS_START(1,1)
364 Z_PARAM_LONG(code)
365 ZEND_PARSE_PARAMETERS_END();
366
367 str = curl_multi_strerror(code);
368 if (str) {
369 RETURN_STRING(str);
370 } else {
371 RETURN_NULL();
372 }
373 }
374 /* }}} */
375
376 #if LIBCURL_VERSION_NUM >= 0x072C00 /* Available since 7.44.0 */
377
_php_server_push_callback(CURL * parent_ch,CURL * easy,size_t num_headers,struct curl_pushheaders * push_headers,void * userp)378 static int _php_server_push_callback(CURL *parent_ch, CURL *easy, size_t num_headers, struct curl_pushheaders *push_headers, void *userp) /* {{{ */
379 {
380 php_curl *ch;
381 php_curl *parent;
382 php_curlm *mh = (php_curlm *)userp;
383 size_t rval = CURL_PUSH_DENY;
384 php_curl_callback *t = mh->handlers.server_push;
385 zval *pz_parent_ch = NULL;
386 zval pz_ch;
387 zval headers;
388 zval retval;
389 char *header;
390 zend_result error;
391 zend_fcall_info fci = empty_fcall_info;
392
393 pz_parent_ch = _php_curl_multi_find_easy_handle(mh, parent_ch);
394 if (pz_parent_ch == NULL) {
395 return rval;
396 }
397
398 if (UNEXPECTED(zend_fcall_info_init(&t->func_name, 0, &fci, &t->fci_cache, NULL, NULL) == FAILURE)) {
399 php_error_docref(NULL, E_WARNING, "Cannot call the CURLMOPT_PUSHFUNCTION");
400 return rval;
401 }
402
403 parent = Z_CURL_P(pz_parent_ch);
404
405 ch = init_curl_handle_into_zval(&pz_ch);
406 ch->cp = easy;
407 _php_setup_easy_copy_handlers(ch, parent);
408
409 size_t i;
410 array_init(&headers);
411 for(i=0; i<num_headers; i++) {
412 header = curl_pushheader_bynum(push_headers, i);
413 add_next_index_string(&headers, header);
414 }
415
416 ZEND_ASSERT(pz_parent_ch);
417 zval call_args[3] = {*pz_parent_ch, pz_ch, headers};
418
419 fci.param_count = 3;
420 fci.params = call_args;
421 fci.retval = &retval;
422
423 error = zend_call_function(&fci, &t->fci_cache);
424 zval_ptr_dtor_nogc(&headers);
425
426 if (error == FAILURE) {
427 php_error_docref(NULL, E_WARNING, "Cannot call the CURLMOPT_PUSHFUNCTION");
428 } else if (!Z_ISUNDEF(retval)) {
429 if (CURL_PUSH_DENY != zval_get_long(&retval)) {
430 rval = CURL_PUSH_OK;
431 zend_llist_add_element(&mh->easyh, &pz_ch);
432 } else {
433 /* libcurl will free this easy handle, avoid double free */
434 ch->cp = NULL;
435 }
436 }
437
438 return rval;
439 }
440 /* }}} */
441
442 #endif
443
_php_curl_multi_setopt(php_curlm * mh,zend_long option,zval * zvalue,zval * return_value)444 static bool _php_curl_multi_setopt(php_curlm *mh, zend_long option, zval *zvalue, zval *return_value) /* {{{ */
445 {
446 CURLMcode error = CURLM_OK;
447
448 switch (option) {
449 case CURLMOPT_PIPELINING:
450 case CURLMOPT_MAXCONNECTS:
451 #if LIBCURL_VERSION_NUM >= 0x071e00 /* 7.30.0 */
452 case CURLMOPT_CHUNK_LENGTH_PENALTY_SIZE:
453 case CURLMOPT_CONTENT_LENGTH_PENALTY_SIZE:
454 case CURLMOPT_MAX_HOST_CONNECTIONS:
455 case CURLMOPT_MAX_PIPELINE_LENGTH:
456 case CURLMOPT_MAX_TOTAL_CONNECTIONS:
457 #endif
458 #if LIBCURL_VERSION_NUM >= 0x074300 /* Available since 7.67.0 */
459 case CURLMOPT_MAX_CONCURRENT_STREAMS:
460 #endif
461 {
462 zend_long lval = zval_get_long(zvalue);
463
464 if (option == CURLMOPT_PIPELINING && (lval & 1)) {
465 #if LIBCURL_VERSION_NUM >= 0x073e00 /* 7.62.0 */
466 php_error_docref(NULL, E_WARNING, "CURLPIPE_HTTP1 is no longer supported");
467 #else
468 php_error_docref(NULL, E_DEPRECATED, "CURLPIPE_HTTP1 is deprecated");
469 #endif
470 }
471 error = curl_multi_setopt(mh->multi, option, lval);
472 break;
473 }
474 #if LIBCURL_VERSION_NUM > 0x072D00 /* Available since 7.45.0 */
475 case CURLMOPT_PUSHFUNCTION:
476 if (mh->handlers.server_push == NULL) {
477 mh->handlers.server_push = ecalloc(1, sizeof(php_curl_callback));
478 } else if (!Z_ISUNDEF(mh->handlers.server_push->func_name)) {
479 zval_ptr_dtor(&mh->handlers.server_push->func_name);
480 mh->handlers.server_push->fci_cache = empty_fcall_info_cache;
481 }
482
483 ZVAL_COPY(&mh->handlers.server_push->func_name, zvalue);
484 error = curl_multi_setopt(mh->multi, CURLMOPT_PUSHFUNCTION, _php_server_push_callback);
485 if (error != CURLM_OK) {
486 return false;
487 }
488 error = curl_multi_setopt(mh->multi, CURLMOPT_PUSHDATA, mh);
489 break;
490 #endif
491 default:
492 zend_argument_value_error(2, "is not a valid cURL multi option");
493 error = CURLM_UNKNOWN_OPTION;
494 break;
495 }
496
497 SAVE_CURLM_ERROR(mh, error);
498
499 return error == CURLM_OK;
500 }
501 /* }}} */
502
503 /* {{{ Set an option for the curl multi handle */
PHP_FUNCTION(curl_multi_setopt)504 PHP_FUNCTION(curl_multi_setopt)
505 {
506 zval *z_mh, *zvalue;
507 zend_long options;
508 php_curlm *mh;
509
510 ZEND_PARSE_PARAMETERS_START(3,3)
511 Z_PARAM_OBJECT_OF_CLASS(z_mh, curl_multi_ce)
512 Z_PARAM_LONG(options)
513 Z_PARAM_ZVAL(zvalue)
514 ZEND_PARSE_PARAMETERS_END();
515
516 mh = Z_CURL_MULTI_P(z_mh);
517
518 if (_php_curl_multi_setopt(mh, options, zvalue, return_value)) {
519 RETURN_TRUE;
520 } else {
521 RETURN_FALSE;
522 }
523 }
524 /* }}} */
525
526 /* CurlMultiHandle class */
527
curl_multi_create_object(zend_class_entry * class_type)528 static zend_object *curl_multi_create_object(zend_class_entry *class_type) {
529 php_curlm *intern = zend_object_alloc(sizeof(php_curlm), class_type);
530
531 zend_object_std_init(&intern->std, class_type);
532 object_properties_init(&intern->std, class_type);
533
534 return &intern->std;
535 }
536
curl_multi_get_constructor(zend_object * object)537 static zend_function *curl_multi_get_constructor(zend_object *object) {
538 zend_throw_error(NULL, "Cannot directly construct CurlMultiHandle, use curl_multi_init() instead");
539 return NULL;
540 }
541
curl_multi_free_obj(zend_object * object)542 static void curl_multi_free_obj(zend_object *object)
543 {
544 php_curlm *mh = curl_multi_from_obj(object);
545
546 zend_llist_position pos;
547 php_curl *ch;
548 zval *pz_ch;
549
550 if (!mh->multi) {
551 /* Can happen if constructor throws. */
552 zend_object_std_dtor(&mh->std);
553 return;
554 }
555
556 for (pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch;
557 pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) {
558 if (!(OBJ_FLAGS(Z_OBJ_P(pz_ch)) & IS_OBJ_FREE_CALLED)) {
559 ch = Z_CURL_P(pz_ch);
560 _php_curl_verify_handlers(ch, /* reporterror */ false);
561 }
562 }
563
564 curl_multi_cleanup(mh->multi);
565 zend_llist_clean(&mh->easyh);
566 if (mh->handlers.server_push) {
567 zval_ptr_dtor(&mh->handlers.server_push->func_name);
568 efree(mh->handlers.server_push);
569 }
570
571 zend_object_std_dtor(&mh->std);
572 }
573
curl_multi_get_gc(zend_object * object,zval ** table,int * n)574 static HashTable *curl_multi_get_gc(zend_object *object, zval **table, int *n)
575 {
576 php_curlm *curl_multi = curl_multi_from_obj(object);
577
578 zend_get_gc_buffer *gc_buffer = zend_get_gc_buffer_create();
579
580 if (curl_multi->handlers.server_push) {
581 zend_get_gc_buffer_add_zval(gc_buffer, &curl_multi->handlers.server_push->func_name);
582 }
583
584 zend_llist_position pos;
585 for (zval *pz_ch = (zval *) zend_llist_get_first_ex(&curl_multi->easyh, &pos); pz_ch;
586 pz_ch = (zval *) zend_llist_get_next_ex(&curl_multi->easyh, &pos)) {
587 zend_get_gc_buffer_add_zval(gc_buffer, pz_ch);
588 }
589
590 zend_get_gc_buffer_use(gc_buffer, table, n);
591
592 return zend_std_get_properties(object);
593 }
594
595 static zend_object_handlers curl_multi_handlers;
596
curl_multi_register_handlers(void)597 void curl_multi_register_handlers(void) {
598 curl_multi_ce->create_object = curl_multi_create_object;
599 curl_multi_ce->default_object_handlers = &curl_multi_handlers;
600
601 memcpy(&curl_multi_handlers, &std_object_handlers, sizeof(zend_object_handlers));
602 curl_multi_handlers.offset = XtOffsetOf(php_curlm, std);
603 curl_multi_handlers.free_obj = curl_multi_free_obj;
604 curl_multi_handlers.get_gc = curl_multi_get_gc;
605 curl_multi_handlers.get_constructor = curl_multi_get_constructor;
606 curl_multi_handlers.clone_obj = NULL;
607 curl_multi_handlers.cast_object = curl_cast_object;
608 curl_multi_handlers.compare = zend_objects_not_comparable;
609 }
610