diff options
author | Wez Furlong <wez@php.net> | 2002-08-12 15:56:13 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2002-08-12 15:56:13 +0000 |
commit | fc1ef270ced1a8c58502a93e582905b979252d17 (patch) | |
tree | aeff79f91edf899952900956697b83affa9d7335 /ext/curl/php_curl.h | |
parent | bdaae34cb9239e6ad3fffa3f7dc357fd835b8d8e (diff) | |
download | php-git-fc1ef270ced1a8c58502a93e582905b979252d17.tar.gz |
Implement curl based wrappers.
Currently read-only, and http is the only thing tested.
Because of this, using them can be controlled by configure:
--with-curlwrappers Use CURL for url streams
Not for production use...
This enables http, https, ftp and ldap protocols as streams.
Diffstat (limited to 'ext/curl/php_curl.h')
-rw-r--r-- | ext/curl/php_curl.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ext/curl/php_curl.h b/ext/curl/php_curl.h index de4e1ca170..471bfb7166 100644 --- a/ext/curl/php_curl.h +++ b/ext/curl/php_curl.h @@ -13,6 +13,7 @@ | license@php.net so we can mail you a copy immediately. | +----------------------------------------------------------------------+ | Author: Sterling Hughes <sterling@php.net> | + | Wez Furlong <wez@thebrainroom.com> | +----------------------------------------------------------------------+ */ @@ -93,6 +94,37 @@ typedef struct { long id; } php_curl; +/* streams support */ + +PHPAPI extern php_stream_ops php_curl_stream_ops; +#define PHP_STREAM_IS_CURL &php_curl_stream_ops + +PHPAPI php_stream *php_curl_stream_opener(php_stream_wrapper *wrapper, char *filename, char *mode, + int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); + +extern php_stream_wrapper php_curl_wrapper; + +struct php_curl_buffer { + off_t readpos, writepos; + php_stream *buf; +}; + +typedef struct { + CURL *curl; + CURLM *multi; + char *url; + struct php_curl_buffer readbuffer; /* holds downloaded data */ + struct php_curl_buffer writebuffer; /* holds data to upload */ + + fd_set readfds, writefds, excfds; + int maxfd; + + char errstr[CURL_ERROR_SIZE + 1]; + CURLMcode mcode; + int pending; + zval *headers; +} php_curl_stream; + #else #define curl_module_ptr NULL |