|
24 | 24 | #include "Zend/zend_smart_str.h" |
25 | 25 |
|
26 | 26 | #include "curl_private.h" |
27 | | -#ifdef PHP_ASYNC_API |
28 | 27 | #include "curl_async.h" |
29 | | -#endif |
30 | 28 |
|
31 | 29 | #include <curl/curl.h> |
32 | 30 | #include <curl/multi.h> |
@@ -223,15 +221,11 @@ PHP_FUNCTION(curl_multi_select) |
223 | 221 | RETURN_THROWS(); |
224 | 222 | } |
225 | 223 |
|
226 | | -#ifdef PHP_ASYNC_API |
227 | 224 | if (ZEND_ASYNC_IS_ACTIVE) { |
228 | 225 | error = curl_async_select(mh, (int) (timeout * 1000.0), &numfds); |
229 | 226 | } else { |
230 | 227 | error = curl_multi_wait(mh->multi, NULL, 0, (int) (timeout * 1000.0), &numfds); |
231 | 228 | } |
232 | | -#else |
233 | | - error = curl_multi_wait(mh->multi, NULL, 0, (int) (timeout * 1000.0), &numfds); |
234 | | -#endif |
235 | 229 | if (CURLM_OK != error) { |
236 | 230 | SAVE_CURLM_ERROR(mh, error); |
237 | 231 | RETURN_LONG(-1); |
@@ -271,15 +265,11 @@ PHP_FUNCTION(curl_multi_exec) |
271 | 265 | } |
272 | 266 |
|
273 | 267 | still_running = zval_get_long(z_still_running); |
274 | | -#ifdef PHP_ASYNC_API |
275 | 268 | if (ZEND_ASYNC_IS_ACTIVE) { |
276 | 269 | error = curl_async_multi_perform(mh, &still_running); |
277 | 270 | } else { |
278 | 271 | error = curl_multi_perform(mh->multi, &still_running); |
279 | 272 | } |
280 | | -#else |
281 | | - error = curl_multi_perform(mh->multi, &still_running); |
282 | | -#endif |
283 | 273 | ZEND_TRY_ASSIGN_REF_LONG(z_still_running, still_running); |
284 | 274 |
|
285 | 275 | SAVE_CURLM_ERROR(mh, error); |
@@ -372,11 +362,9 @@ PHP_FUNCTION(curl_multi_close) |
372 | 362 |
|
373 | 363 | mh = Z_CURL_MULTI_P(z_mh); |
374 | 364 |
|
375 | | -#ifdef PHP_ASYNC_API |
376 | 365 | if (mh->async_event) { |
377 | 366 | curl_async_dtor(mh); |
378 | 367 | } |
379 | | -#endif |
380 | 368 |
|
381 | 369 | for (pz_ch = (zval *)zend_llist_get_first_ex(&mh->easyh, &pos); pz_ch; |
382 | 370 | pz_ch = (zval *)zend_llist_get_next_ex(&mh->easyh, &pos)) { |
@@ -575,9 +563,7 @@ static void curl_multi_free_obj(zend_object *object) |
575 | 563 | { |
576 | 564 | php_curlm *mh = curl_multi_from_obj(object); |
577 | 565 |
|
578 | | -#ifdef PHP_ASYNC_API |
579 | 566 | curl_async_dtor(mh); |
580 | | -#endif |
581 | 567 |
|
582 | 568 | zend_llist_position pos; |
583 | 569 | php_curl *ch; |
|
0 commit comments