- make request_exec() always succeed (picky curl)
[m6w6/ext-http] / php_http_request_pool_api.h
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-2005, Michael Wallner <mike@php.net> |
10 +--------------------------------------------------------------------+
11 */
12
13 /* $Id$ */
14
15 #ifndef PHP_HTTP_REQUEST_POOL_API_H
16 #define PHP_HTTP_REQUEST_POOL_API_H
17 #ifdef HTTP_HAVE_CURL
18
19 #include "php_http_std_defs.h"
20 #include "php_http_request_api.h"
21 #include "phpstr/phpstr.h"
22
23 #ifdef PHP_WIN32
24 # include <winsock2.h>
25 #endif
26
27 #include <curl/curl.h>
28
29 typedef struct {
30 CURLM *ch;
31 zend_llist finished;
32 zend_llist handles;
33 zend_llist bodies;
34 int unfinished;
35 } http_request_pool;
36
37 #define http_request_pool_responsehandler _http_request_pool_responsehandler
38 extern void _http_request_pool_responsehandler(zval **req, CURL *ch TSRMLS_DC);
39 #define http_request_pool_requesthandler(r, b) _http_request_pool_requesthandler((r), (b) TSRMLS_CC)
40 extern STATUS _http_request_pool_requesthandler(zval *request, http_request_body *body TSRMLS_DC);
41
42 #define http_request_pool_init(p) _http_request_pool_init((p) TSRMLS_CC)
43 PHP_HTTP_API http_request_pool *_http_request_pool_init(http_request_pool *pool TSRMLS_DC);
44
45 #define http_request_pool_attach(p, r) _http_request_pool_attach((p), (r) TSRMLS_CC)
46 PHP_HTTP_API STATUS _http_request_pool_attach(http_request_pool *pool, zval *request TSRMLS_DC);
47
48 #define http_request_pool_detach(p, r) _http_request_pool_detach((p), (r) TSRMLS_CC)
49 PHP_HTTP_API STATUS _http_request_pool_detach(http_request_pool *pool, zval *request TSRMLS_DC);
50
51 #define http_request_pool_detach_all(p) _http_request_pool_detach_all((p) TSRMLS_CC)
52 PHP_HTTP_API void _http_request_pool_detach_all(http_request_pool *pool TSRMLS_DC);
53
54 #define http_request_pool_send(p) _http_request_pool_send((p) TSRMLS_CC)
55 PHP_HTTP_API STATUS _http_request_pool_send(http_request_pool *pool TSRMLS_DC);
56
57 #define http_request_pool_select _http_request_pool_select
58 PHP_HTTP_API STATUS _http_request_pool_select(http_request_pool *pool);
59
60 #define http_request_pool_perform(p) _http_request_pool_perform((p) TSRMLS_CC)
61 PHP_HTTP_API int _http_request_pool_perform(http_request_pool *pool TSRMLS_DC);
62
63 #define http_request_pool_dtor(p) _http_request_pool_dtor((p) TSRMLS_CC)
64 PHP_HTTP_API void _http_request_pool_dtor(http_request_pool *pool TSRMLS_DC);
65
66 #endif
67 #endif
68
69 /*
70 * Local variables:
71 * tab-width: 4
72 * c-basic-offset: 4
73 * End:
74 * vim600: noet sw=4 ts=4 fdm=marker
75 * vim<600: noet sw=4 ts=4
76 */
77