php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
curl_private.h
Go to the documentation of this file.
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 | Wez Furlong <wez@thebrainroom.com> |
15 +----------------------------------------------------------------------+
16*/
17
18#ifndef _PHP_CURL_PRIVATE_H
19#define _PHP_CURL_PRIVATE_H
20
21#include "php_curl.h"
22
23#define PHP_CURL_DEBUG 0
24
25#include "php_version.h"
26#define PHP_CURL_VERSION PHP_VERSION
27
28#include <curl/curl.h>
29#include <curl/multi.h>
30
31#define CURLOPT_RETURNTRANSFER 19913
32#define CURLOPT_BINARYTRANSFER 19914 /* For Backward compatibility */
33#define PHP_CURL_STDOUT 0
34#define PHP_CURL_FILE 1
35#define PHP_CURL_USER 2
36#define PHP_CURL_DIRECT 3
37#define PHP_CURL_RETURN 4
38#define PHP_CURL_IGNORE 7
39
40#define SAVE_CURL_ERROR(__handle, __err) \
41 do { (__handle)->err.no = (int) __err; } while (0)
42
46
54
62
63typedef struct {
72#if LIBCURL_VERSION_NUM >= 0x075000 /* Available since 7.80.0 */
74#endif
75#if LIBCURL_VERSION_NUM >= 0x075400 /* Available since 7.84.0 */
76 zend_fcall_info_cache sshhostkey;
77#endif
79
81 char str[CURL_ERROR_SIZE + 1];
82 int no;
83};
84
88
94
95typedef struct {
96 CURL *cp;
102 uint32_t* clone;
104 /* For CURLOPT_PRIVATE */
106 /* CurlShareHandle object set using CURLOPT_SHARE. */
109} php_curl;
110
111#define CURLOPT_SAFE_UPLOAD -1
112
116
126
127typedef struct _php_curlsh {
128 CURLSH *share;
129 struct {
130 int no;
134
139void _php_curl_verify_handlers(php_curl *ch, bool reporterror);
141
142static inline php_curl *curl_from_obj(zend_object *obj) {
143 return (php_curl *)((char *)(obj) - XtOffsetOf(php_curl, std));
144}
145
146#define Z_CURL_P(zv) curl_from_obj(Z_OBJ_P(zv))
147
148static inline php_curlsh *curl_share_from_obj(zend_object *obj) {
149 return (php_curlsh *)((char *)(obj) - XtOffsetOf(php_curlsh, std));
150}
151
152#define Z_CURL_SHARE_P(zv) curl_share_from_obj(Z_OBJ_P(zv))
153
156void curlfile_register_class(void);
158
159#endif /* _PHP_CURL_PRIVATE_H */
void curl_share_register_handlers(void)
Definition share.c:163
void init_curl_handle(php_curl *ch)
Definition interface.c:1122
void curl_multi_register_handlers(void)
Definition multi.c:583
struct _php_curlsh php_curlsh
php_curl * init_curl_handle_into_zval(zval *curl)
Definition interface.c:1110
void _php_curl_multi_cleanup_list(void *data)
Definition multi.c:112
zend_result curl_cast_object(zend_object *obj, zval *result, int type)
Definition interface.c:530
void curlfile_register_class(void)
Definition curl_file.c:146
void _php_curl_cleanup_handle(php_curl *)
Definition interface.c:2404
void _php_curl_verify_handlers(php_curl *ch, bool reporterror)
Definition interface.c:143
void _php_setup_easy_copy_handlers(php_curl *ch, php_curl *source)
Definition interface.c:1263
zend_ffi_type * type
Definition ffi.c:3812
zend_long ch
Definition ffi.c:4580
char * err
Definition ffi.c:3029
#define PHP_MSHUTDOWN_FUNCTION
Definition php.h:401
#define PHP_MINIT_FUNCTION
Definition php.h:400
#define PHP_MINFO_FUNCTION
Definition php.h:404
zend_constant * data
char str[CURL_ERROR_SIZE+1]
HashTable * slist
zend_llist post
zend_llist stream
CURLSH * share
zend_object std
zend_fcall_info_cache fnmatch
zend_fcall_info_cache progress
php_curl_write * write
php_curl_read * read
zend_fcall_info_cache debug
php_curl_write * write_header
zend_fcall_info_cache xferinfo
zend_resource * res
zend_fcall_info_cache fcc
zend_fcall_info_cache fcc
smart_str buf
struct _php_curl_send_headers header
struct _php_curl_error err
CURL * cp
struct _php_curlsh * share
zval private_data
zval postfields
struct _php_curl_free * to_free
bool in_callback
zend_object std
uint32_t * clone
php_curl_handlers handlers
zend_fcall_info_cache server_push
zend_llist easyh
CURLM * multi
zend_object std
php_curlm_handlers handlers
struct _zend_fcall_info_cache zend_fcall_info_cache
struct _zval_struct zval
struct _zend_llist zend_llist
struct _zend_string zend_string
#define XtOffsetOf(s_type, field)
struct _zend_object zend_object
struct _zend_resource zend_resource
Definition zend_types.h:99
struct _zend_array HashTable
Definition zend_types.h:386
ZEND_RESULT_CODE zend_result
Definition zend_types.h:64
bool result