b90d19de23b4d21cc257e4a8551f3cf11076e1db
[m6w6/ext-http] / http_request_pool_api.c
1 /*
2 +--------------------------------------------------------------------+
3 | PECL :: http |
4 +--------------------------------------------------------------------+
5 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the conditions mentioned |
7 | in the accompanying LICENSE file are met. |
8 +--------------------------------------------------------------------+
9 | Copyright (c) 2004-2007, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 /* $Id$ */
14
15 #define HTTP_WANT_CURL
16 #define HTTP_WANT_EVENT
17 #include "php_http.h"
18
19 #if defined(ZEND_ENGINE_2) && defined(HTTP_HAVE_CURL)
20
21 #include "php_http_api.h"
22 #include "php_http_exception_object.h"
23 #include "php_http_persistent_handle_api.h"
24 #include "php_http_request_api.h"
25 #include "php_http_request_object.h"
26 #include "php_http_request_pool_api.h"
27 #include "php_http_requestpool_object.h"
28
29 #ifndef HTTP_DEBUG_REQPOOLS
30 # define HTTP_DEBUG_REQPOOLS 0
31 #endif
32
33 #ifdef HTTP_HAVE_EVENT
34 typedef struct _http_request_pool_event_t {
35 struct event evnt;
36 http_request_pool *pool;
37 } http_request_pool_event;
38
39 static inline void http_request_pool_update_timeout(http_request_pool *pool);
40 static void http_request_pool_timeout_callback(int socket, short action, void *event_data);
41 static void http_request_pool_event_callback(int socket, short action, void *event_data);
42 static int http_request_pool_socket_callback(CURL *easy, curl_socket_t s, int action, void *, void *);
43 #endif
44
45 static int http_request_pool_compare_handles(void *h1, void *h2);
46
47 PHP_MINIT_FUNCTION(http_request_pool)
48 {
49 if (SUCCESS != http_persistent_handle_provide("http_request_pool", curl_multi_init, (http_persistent_handle_dtor) curl_multi_cleanup, NULL)) {
50 return FAILURE;
51 }
52 return SUCCESS;
53 }
54
55 #ifdef HTTP_HAVE_EVENT
56 PHP_RINIT_FUNCTION(http_request_pool)
57 {
58 if (!HTTP_G->request.pool.event.base && !(HTTP_G->request.pool.event.base = event_init())) {
59 return FAILURE;
60 }
61
62 return SUCCESS;
63 }
64 #endif
65
66 /* {{{ http_request_pool *http_request_pool_init(http_request_pool *) */
67 PHP_HTTP_API http_request_pool *_http_request_pool_init(http_request_pool *pool TSRMLS_DC)
68 {
69 zend_bool free_pool;
70
71 #if HTTP_DEBUG_REQPOOLS
72 fprintf(stderr, "Initializing request pool %p\n", pool);
73 #endif
74
75 if ((free_pool = (!pool))) {
76 pool = emalloc(sizeof(http_request_pool));
77 pool->ch = NULL;
78 }
79
80 if (SUCCESS != http_persistent_handle_acquire("http_request_pool", &pool->ch)) {
81 if (free_pool) {
82 efree(pool);
83 }
84 return NULL;
85 }
86
87 TSRMLS_SET_CTX(pool->tsrm_ls);
88
89 #if HTTP_HAVE_EVENT
90 pool->timeout = ecalloc(1, sizeof(struct event));
91 curl_multi_setopt(pool->ch, CURLMOPT_SOCKETDATA, pool);
92 curl_multi_setopt(pool->ch, CURLMOPT_SOCKETFUNCTION, http_request_pool_socket_callback);
93 #endif
94
95 pool->unfinished = 0;
96 zend_llist_init(&pool->finished, sizeof(zval *), (llist_dtor_func_t) ZVAL_PTR_DTOR, 0);
97 zend_llist_init(&pool->handles, sizeof(zval *), (llist_dtor_func_t) ZVAL_PTR_DTOR, 0);
98
99 #if HTTP_DEBUG_REQPOOLS
100 fprintf(stderr, "Initialized request pool %p\n", pool);
101 #endif
102
103 return pool;
104 }
105 /* }}} */
106
107 /* {{{ STATUS http_request_pool_attach(http_request_pool *, zval *) */
108 PHP_HTTP_API STATUS _http_request_pool_attach(http_request_pool *pool, zval *request)
109 {
110 TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls);
111 getObjectEx(http_request_object, req, request);
112
113 #if HTTP_DEBUG_REQPOOLS
114 fprintf(stderr, "Attaching HttpRequest(#%d) %p to pool %p\n", Z_OBJ_HANDLE_P(request), req, pool);
115 #endif
116
117 if (req->pool) {
118 http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "HttpRequest object(#%d) is already member of %s HttpRequestPool", Z_OBJ_HANDLE_P(request), req->pool == pool ? "this" : "another");
119 } else if (SUCCESS != http_request_object_requesthandler(req, request)) {
120 http_error_ex(HE_WARNING, HTTP_E_REQUEST, "Could not initialize HttpRequest object(#%d) for attaching to the HttpRequestPool", Z_OBJ_HANDLE_P(request));
121 } else {
122 CURLMcode code = curl_multi_add_handle(pool->ch, req->request->ch);
123
124 if ((CURLM_OK != code) && (CURLM_CALL_MULTI_PERFORM != code)) {
125 http_error_ex(HE_WARNING, HTTP_E_REQUEST_POOL, "Could not attach HttpRequest object(#%d) to the HttpRequestPool: %s", Z_OBJ_HANDLE_P(request), curl_multi_strerror(code));
126 } else {
127 req->pool = pool;
128
129 ZVAL_ADDREF(request);
130 zend_llist_add_element(&pool->handles, &request);
131
132 #if HTTP_DEBUG_REQPOOLS
133 fprintf(stderr, "> %d HttpRequests attached to pool %p\n", zend_llist_count(&pool->handles), pool);
134 #endif
135 return SUCCESS;
136 }
137 }
138 return FAILURE;
139 }
140 /* }}} */
141
142 /* {{{ STATUS http_request_pool_detach(http_request_pool *, zval *) */
143 PHP_HTTP_API STATUS _http_request_pool_detach(http_request_pool *pool, zval *request)
144 {
145 CURLMcode code;
146 TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls);
147 getObjectEx(http_request_object, req, request);
148
149 #if HTTP_DEBUG_REQPOOLS
150 fprintf(stderr, "Detaching HttpRequest(#%d) %p from pool %p\n", Z_OBJ_HANDLE_P(request), req, pool);
151 #endif
152
153 if (!req->pool) {
154 /* not attached to any pool */
155 #if HTTP_DEBUG_REQPOOLS
156 fprintf(stderr, "HttpRequest object(#%d) %p is not attached to any HttpRequestPool\n", Z_OBJ_HANDLE_P(request), req);
157 #endif
158 } else if (req->pool != pool) {
159 http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "HttpRequest object(#%d) is not attached to this HttpRequestPool", Z_OBJ_HANDLE_P(request));
160 } else if (req->request->_in_progress_cb) {
161 http_error_ex(HE_WARNING, HTTP_E_REQUEST_POOL, "HttpRequest object(#%d) cannot be detached from the HttpRequestPool while executing the progress callback", Z_OBJ_HANDLE_P(request));
162 } else if (CURLM_OK != (code = curl_multi_remove_handle(pool->ch, req->request->ch))) {
163 http_error_ex(HE_WARNING, HTTP_E_REQUEST_POOL, "Could not detach HttpRequest object(#%d) from the HttpRequestPool: %s", Z_OBJ_HANDLE_P(request), curl_multi_strerror(code));
164 } else {
165 req->pool = NULL;
166 zend_llist_del_element(&pool->finished, request, http_request_pool_compare_handles);
167 zend_llist_del_element(&pool->handles, request, http_request_pool_compare_handles);
168
169 #if HTTP_DEBUG_REQPOOLS
170 fprintf(stderr, "> %d HttpRequests remaining in pool %p\n", zend_llist_count(&pool->handles), pool);
171 #endif
172
173 return SUCCESS;
174 }
175 return FAILURE;
176 }
177 /* }}} */
178
179 /* {{{ void http_request_pool_apply(http_request_pool *, http_request_pool_apply_func) */
180 PHP_HTTP_API void _http_request_pool_apply(http_request_pool *pool, http_request_pool_apply_func cb)
181 {
182 int count = zend_llist_count(&pool->handles);
183
184 if (count) {
185 int i = 0;
186 zend_llist_position pos;
187 zval **handle, **handles = emalloc(count * sizeof(zval *));
188
189 for (handle = zend_llist_get_first_ex(&pool->handles, &pos); handle; handle = zend_llist_get_next_ex(&pool->handles, &pos)) {
190 handles[i++] = *handle;
191 }
192
193 /* should never happen */
194 if (i != count) {
195 zend_error(E_ERROR, "number of fetched request handles do not match overall count");
196 count = i;
197 }
198
199 for (i = 0; i < count; ++i) {
200 if (cb(pool, handles[i])) {
201 break;
202 }
203 }
204 efree(handles);
205 }
206 }
207 /* }}} */
208
209 /* {{{ void http_request_pool_apply_with_arg(http_request_pool *, http_request_pool_apply_with_arg_func, void *) */
210 PHP_HTTP_API void _http_request_pool_apply_with_arg(http_request_pool *pool, http_request_pool_apply_with_arg_func cb, void *arg)
211 {
212 int count = zend_llist_count(&pool->handles);
213
214 if (count) {
215 int i = 0;
216 zend_llist_position pos;
217 zval **handle, **handles = emalloc(count * sizeof(zval *));
218
219 for (handle = zend_llist_get_first_ex(&pool->handles, &pos); handle; handle = zend_llist_get_next_ex(&pool->handles, &pos)) {
220 handles[i++] = *handle;
221 }
222
223 /* should never happen */
224 if (i != count) {
225 zend_error(E_ERROR, "number of fetched request handles do not match overall count");
226 count = i;
227 }
228
229 for (i = 0; i < count; ++i) {
230 if (cb(pool, handles[i], arg)) {
231 break;
232 }
233 }
234 efree(handles);
235 }
236 }
237 /* }}} */
238
239 /* {{{ void http_request_pool_detach_all(http_request_pool *) */
240 PHP_HTTP_API void _http_request_pool_detach_all(http_request_pool *pool)
241 {
242 #if HTTP_DEBUG_REQPOOLS
243 fprintf(stderr, "Detaching %d requests from pool %p\n", zend_llist_count(&pool->handles), pool);
244 #endif
245 http_request_pool_apply(pool, _http_request_pool_detach);
246 }
247 /* }}} */
248
249 /* {{{ STATUS http_request_pool_send(http_request_pool *) */
250 PHP_HTTP_API STATUS _http_request_pool_send(http_request_pool *pool)
251 {
252 TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls);
253
254 #if HTTP_DEBUG_REQPOOLS
255 fprintf(stderr, "Attempt to send %d requests of pool %p\n", zend_llist_count(&pool->handles), pool);
256 #endif
257
258 #ifdef HTTP_HAVE_EVENT
259 while (CURLM_CALL_MULTI_PERFORM == curl_multi_socket_all(pool->ch, &pool->unfinished));
260 http_request_pool_update_timeout(pool);
261
262 event_base_dispatch(HTTP_G->request.pool.event.base);
263 #else
264 while (http_request_pool_perform(pool)) {
265 if (SUCCESS != http_request_pool_select(pool)) {
266 # ifdef PHP_WIN32
267 /* see http://msdn.microsoft.com/library/en-us/winsock/winsock/windows_sockets_error_codes_2.asp */
268 http_error_ex(HE_WARNING, HTTP_E_SOCKET, "WinSock error: %d", WSAGetLastError());
269 # else
270 http_error(HE_WARNING, HTTP_E_SOCKET, strerror(errno));
271 # endif
272 return FAILURE;
273 }
274 }
275 #endif
276
277 #if HTTP_DEBUG_REQPOOLS
278 fprintf(stderr, "Finished sending %d HttpRequests of pool %p (still unfinished: %d)\n", zend_llist_count(&pool->handles), pool, pool->unfinished);
279 #endif
280
281 return SUCCESS;
282 }
283 /* }}} */
284
285 /* {{{ void http_request_pool_dtor(http_request_pool *) */
286 PHP_HTTP_API void _http_request_pool_dtor(http_request_pool *pool)
287 {
288 TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls);
289
290 #if HTTP_DEBUG_REQPOOLS
291 fprintf(stderr, "Destructing request pool %p\n", pool);
292 #endif
293
294 #if HTTP_HAVE_EVENT
295 efree(pool->timeout);
296 #endif
297
298 pool->unfinished = 0;
299 zend_llist_clean(&pool->finished);
300 zend_llist_clean(&pool->handles);
301 http_persistent_handle_release("http_request_pool", &pool->ch);
302 }
303 /* }}} */
304
305 #ifdef PHP_WIN32
306 # define SELECT_ERROR SOCKET_ERROR
307 #else
308 # define SELECT_ERROR -1
309 #endif
310
311 /* {{{ STATUS http_request_pool_select(http_request_pool *) */
312 PHP_HTTP_API STATUS _http_request_pool_select(http_request_pool *pool)
313 {
314 #ifdef HTTP_HAVE_EVENT
315 TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls);
316 http_error(HE_WARNING, HTTP_E_RUNTIME, "not implemented; use HttpRequest::onProgress callback");
317 return FAILURE;
318 #else
319 int MAX;
320 fd_set R, W, E;
321 struct timeval timeout;
322
323 http_request_pool_timeout(pool, &timeout);
324
325 FD_ZERO(&R);
326 FD_ZERO(&W);
327 FD_ZERO(&E);
328
329 if (CURLM_OK == curl_multi_fdset(pool->ch, &R, &W, &E, &MAX)) {
330 if (MAX == -1) {
331 http_sleep((double) timeout.tv_sec + (double) (timeout.tv_usec / HTTP_MCROSEC));
332 return SUCCESS;
333 } else if (SELECT_ERROR != select(MAX + 1, &R, &W, &E, &timeout)) {
334 return SUCCESS;
335 }
336 }
337 return FAILURE;
338 #endif
339 }
340 /* }}} */
341
342 /* {{{ int http_request_pool_perform(http_request_pool *) */
343 PHP_HTTP_API int _http_request_pool_perform(http_request_pool *pool)
344 {
345 TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls);
346 #ifdef HTTP_HAVE_EVENT
347 http_error(HE_WARNING, HTTP_E_RUNTIME, "not implemented; use HttpRequest::onProgress callback");
348 return FAILURE;
349 #else
350 CURLMsg *msg;
351 int remaining = 0;
352
353 while (CURLM_CALL_MULTI_PERFORM == curl_multi_perform(pool->ch, &pool->unfinished));
354
355 http_request_pool_response_handler(pool);
356
357 return pool->unfinished;
358 #endif
359 }
360 /* }}} */
361
362 /* {{{ void http_request_pool_responsehandler(http_request_pool *) */
363 void _http_request_pool_responsehandler(http_request_pool *pool)
364 {
365 CURLMsg *msg;
366 int remaining = 0;
367 TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls);
368
369 do {
370 msg = curl_multi_info_read(pool->ch, &remaining);
371 if (msg && CURLMSG_DONE == msg->msg) {
372 if (CURLE_OK != msg->data.result) {
373 http_request *r = NULL;
374 curl_easy_getinfo(msg->easy_handle, CURLINFO_PRIVATE, &r);
375 http_error_ex(HE_WARNING, HTTP_E_REQUEST, "%s; %s (%s)", curl_easy_strerror(msg->data.result), r?r->_error:"", r?r->url:"");
376 }
377 http_request_pool_apply_with_arg(pool, _http_request_pool_apply_responsehandler, msg->easy_handle);
378 }
379 } while (remaining);
380 }
381 /* }}} */
382
383 /* {{{ int http_request_pool_apply_responsehandler(http_request_pool *, zval *, void *) */
384 int _http_request_pool_apply_responsehandler(http_request_pool *pool, zval *req, void *ch)
385 {
386 TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls);
387 getObjectEx(http_request_object, obj, req);
388
389 if ((!ch) || obj->request->ch == (CURL *) ch) {
390
391 #if HTTP_DEBUG_REQPOOLS
392 fprintf(stderr, "Fetching data from HttpRequest(#%d) %p of pool %p\n", Z_OBJ_HANDLE_P(req), obj, obj->pool);
393 #endif
394
395 ZVAL_ADDREF(req);
396 zend_llist_add_element(&obj->pool->finished, &req);
397 http_request_object_responsehandler(obj, req);
398 return 1;
399 }
400 return 0;
401 }
402 /* }}} */
403
404 /* {{{ struct timeval *_http_request_pool_timeout(http_request_pool *, struct timeval *) */
405 struct timeval *_http_request_pool_timeout(http_request_pool *pool, struct timeval *timeout)
406 {
407 #ifdef HAVE_CURL_MULTI_TIMEOUT
408 long max_tout = 1000;
409
410 if ((CURLM_OK == curl_multi_timeout(pool->ch, &max_tout)) && (max_tout != -1)) {
411 timeout->tv_sec = max_tout / 1000;
412 timeout->tv_usec = (max_tout % 1000) * 1000;
413 } else {
414 #endif
415 timeout->tv_sec = 1;
416 timeout->tv_usec = 0;
417 #ifdef HAVE_CURL_MULTI_TIMEOUT
418 }
419 #endif
420
421 #if HTTP_DEBUG_REQPOOLS
422 fprintf(stderr, "Calculating timeout (%lu, %lu) of pool %p\n", (ulong) timeout->tv_sec, (ulong) timeout->tv_usec, pool);
423 #endif
424
425 return timeout;
426 }
427 /* }}} */
428
429 /*#*/
430
431 /* {{{ static int http_request_pool_compare_handles(void *, void *) */
432 static int http_request_pool_compare_handles(void *h1, void *h2)
433 {
434 return (Z_OBJ_HANDLE_PP((zval **) h1) == Z_OBJ_HANDLE_P((zval *) h2));
435 }
436 /* }}} */
437
438 #ifdef HTTP_HAVE_EVENT
439 /* {{{ static void http_request_pool_update_timeout(http_request_pool *) */
440 static inline void http_request_pool_update_timeout(http_request_pool *pool)
441 {
442 struct timeval timeout;
443 TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls);
444
445 if (event_initialized(pool->timeout)) {
446 event_del(pool->timeout);
447 }
448
449 if (pool->unfinished) {
450 event_set(pool->timeout, -1, 0, http_request_pool_timeout_callback, pool);
451 event_base_set(HTTP_G->request.pool.event.base, pool->timeout);
452 event_add(pool->timeout, http_request_pool_timeout(pool, &timeout));
453
454 #if HTTP_DEBUG_REQPOOLS
455 fprintf(stderr, "Updating timeout (%lu, %lu) of pool %p\n", (ulong) timeout.tv_sec, (ulong) timeout.tv_usec, pool);
456 #endif
457 }
458 #if HTTP_DEBUG_REQPOOLS
459 else fprintf(stderr, "Removed timeout of pool %p\n", pool);
460 #endif
461 }
462 /* }}} */
463
464 /* {{{ static void http_request_pool_timeout_callback(int, short, void *) */
465 static void http_request_pool_timeout_callback(int socket, short action, void *event_data)
466 {
467 CURLMcode rc;
468 http_request_pool *pool = event_data;
469 TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls);
470
471 #if HTTP_DEBUG_REQPOOLS
472 fprintf(stderr, "Timeout occurred of pool %p\n", pool);
473 #endif
474
475 while (CURLM_CALL_MULTI_PERFORM == (rc = curl_multi_socket(pool->ch, CURL_SOCKET_TIMEOUT, &pool->unfinished)));
476
477 if (CURLM_OK != rc) {
478 http_error(HE_WARNING, HTTP_E_SOCKET, curl_multi_strerror(rc));
479 }
480
481 http_request_pool_update_timeout(pool);
482 }
483 /* }}} */
484
485 /* {{{ static void http_request_pool_event_callback(int, short, void *) */
486 static void http_request_pool_event_callback(int socket, short action, void *event_data)
487 {
488 CURLMcode rc = CURLE_OK;
489 http_request_pool_event *ev = event_data;
490 http_request_pool *pool = ev->pool;
491 TSRMLS_FETCH_FROM_CTX(ev->pool->tsrm_ls);
492
493 #if HTTP_DEBUG_REQPOOLS
494 {
495 static const char event_strings[][20] = {"NONE","TIMEOUT","READ","TIMEOUT|READ","WRITE","TIMEOUT|WRITE","READ|WRITE","TIMEOUT|READ|WRITE","SIGNAL"};
496 fprintf(stderr, "Event on socket %d (%s) event %p of pool %p\n", socket, event_strings[action], ev, pool);
497 }
498 #endif
499
500 /* don't use 'ev' below this loop as it might 've been freed in the socket callback */
501 do {
502 #ifdef HAVE_CURL_MULTI_SOCKET_ACTION
503 switch (action & (EV_READ|EV_WRITE)) {
504 case EV_READ:
505 rc = curl_multi_socket_action(pool->ch, socket, CURL_CSELECT_IN, &pool->unfinished);
506 break;
507 case EV_WRITE:
508 rc = curl_multi_socket_action(pool->ch, socket, CURL_CSELECT_OUT, &pool->unfinished);
509 break;
510 case EV_READ|EV_WRITE:
511 rc = curl_multi_socket_action(pool->chm socket, CURL_CSELECT_IN|CURL_CSELECT_OUT, &pool->unfinished);
512 break;
513 default:
514 http_error(HE_WARNING, HTTP_E_SOCKET, "Unknown event %d", (int) action);
515 return;
516 }
517 #else
518 rc = curl_multi_socket(pool->ch, socket, &pool->unfinished);
519 #endif
520 } while (CURLM_CALL_MULTI_PERFORM == rc);
521
522 if (CURLM_OK != rc) {
523 http_error(HE_WARNING, HTTP_E_SOCKET, curl_multi_strerror(rc));
524 }
525
526 http_request_pool_responsehandler(pool);
527
528 if (!pool->unfinished) {
529 http_request_pool_update_timeout(pool);
530 }
531 }
532 /* }}} */
533
534 /* {{{ static int http_request_pool_socket_callback(CURL *, curl_socket_t, int, void *, void *) */
535 static int http_request_pool_socket_callback(CURL *easy, curl_socket_t sock, int action, void *socket_data, void *assign_data)
536 {
537 int events = EV_PERSIST;
538 http_request_pool *pool = socket_data;
539 http_request_pool_event *ev = assign_data;
540 TSRMLS_FETCH_FROM_CTX(pool->tsrm_ls);
541
542 if (!ev) {
543 ev = ecalloc(1, sizeof(http_request_pool_event));
544 ev->pool = pool;
545 curl_multi_assign(pool->ch, sock, ev);
546 } else {
547 event_del(&ev->evnt);
548 }
549
550 #if HTTP_DEBUG_REQPOOLS
551 {
552 static const char action_strings[][8] = {"NONE", "IN", "OUT", "INOUT", "REMOVE"};
553 fprintf(stderr, "Callback on socket %d (%s) event %p of pool %p\n", (int) sock, action_strings[action], ev, pool);
554 }
555 #endif
556
557 switch (action) {
558 case CURL_POLL_IN:
559 events |= EV_READ;
560 break;
561 case CURL_POLL_OUT:
562 events |= EV_WRITE;
563 break;
564 case CURL_POLL_INOUT:
565 events |= EV_READ|EV_WRITE;
566 break;
567
568 case CURL_POLL_REMOVE:
569 efree(ev);
570 case CURL_POLL_NONE:
571 return 0;
572
573 default:
574 http_error_ex(HE_WARNING, HTTP_E_SOCKET, "Unknown socket action %d", action);
575 return -1;
576 }
577
578 event_set(&ev->evnt, sock, events, http_request_pool_event_callback, ev);
579 event_base_set(HTTP_G->request.pool.event.base, &ev->evnt);
580 event_add(&ev->evnt, NULL);
581
582 return 0;
583 }
584 /* }}} */
585 #endif /* HTTP_HAVE_EVENT */
586
587 #endif /* ZEND_ENGINE_2 && HTTP_HAVE_CURL */
588
589
590 /*
591 * Local variables:
592 * tab-width: 4
593 * c-basic-offset: 4
594 * End:
595 * vim600: noet sw=4 ts=4 fdm=marker
596 * vim<600: noet sw=4 ts=4
597 */
598