projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
Fix: curl_easy_setopt expects a curl_write_callback argument for this option
[m6w6/ext-http]
/
src
/
php_http_client_response.c
diff --git
a/src/php_http_client_response.c
b/src/php_http_client_response.c
index b1377fe64c7b3d49aed4604c992501de9b4026c3..722b4e03ac1b58494593f0a35430098f76be3b72 100644
(file)
--- a/
src/php_http_client_response.c
+++ b/
src/php_http_client_response.c
@@
-12,6
+12,12
@@
#include "php_http_api.h"
#include "php_http_api.h"
+static zend_class_entry *php_http_client_response_class_entry;
+zend_class_entry *php_http_get_client_response_class_entry(void)
+{
+ return php_http_client_response_class_entry;
+}
+
ZEND_BEGIN_ARG_INFO_EX(ai_HttpClientResponse_getCookies, 0, 0, 0)
ZEND_ARG_INFO(0, flags)
ZEND_ARG_INFO(0, allowed_extras)
ZEND_BEGIN_ARG_INFO_EX(ai_HttpClientResponse_getCookies, 0, 0, 0)
ZEND_ARG_INFO(0, flags)
ZEND_ARG_INFO(0, allowed_extras)
@@
-57,7
+63,7
@@
static PHP_METHOD(HttpClientResponse, getCookies)
if ((list = php_http_cookie_list_parse(NULL, zs->val, zs->len, flags, allowed_extras))) {
zval cookie;
if ((list = php_http_cookie_list_parse(NULL, zs->val, zs->len, flags, allowed_extras))) {
zval cookie;
- ZVAL_OBJ(&cookie, &php_http_cookie_object_new_ex(php_http_cookie_
class_entry
, list)->zo);
+ ZVAL_OBJ(&cookie, &php_http_cookie_object_new_ex(php_http_cookie_
get_class_entry()
, list)->zo);
add_next_index_zval(return_value, &cookie);
}
zend_string_release(zs);
add_next_index_zval(return_value, &cookie);
}
zend_string_release(zs);
@@
-69,7
+75,7
@@
static PHP_METHOD(HttpClientResponse, getCookies)
if ((list = php_http_cookie_list_parse(NULL, zs->val, zs->len, flags, allowed_extras))) {
zval cookie;
if ((list = php_http_cookie_list_parse(NULL, zs->val, zs->len, flags, allowed_extras))) {
zval cookie;
- ZVAL_OBJ(&cookie, &php_http_cookie_object_new_ex(php_http_cookie_
class_entry
, list)->zo);
+ ZVAL_OBJ(&cookie, &php_http_cookie_object_new_ex(php_http_cookie_
get_class_entry()
, list)->zo);
add_next_index_zval(return_value, &cookie);
}
zend_string_release(zs);
add_next_index_zval(return_value, &cookie);
}
zend_string_release(zs);
@@
-95,16
+101,16
@@
static PHP_METHOD(HttpClientResponse, getTransferInfo)
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &info_name, &info_len), invalid_arg, return);
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &info_name, &info_len), invalid_arg, return);
- info = zend_read_property(php_http_client_response_class_entry,
getThis(
), ZEND_STRL("transferInfo"), 0, &info_tmp);
+ info = zend_read_property(php_http_client_response_class_entry,
Z_OBJ_P(ZEND_THIS
), ZEND_STRL("transferInfo"), 0, &info_tmp);
/* request completed? */
if (Z_TYPE_P(info) != IS_OBJECT) {
/* request completed? */
if (Z_TYPE_P(info) != IS_OBJECT) {
- php_http_throw(bad_method_call, "Incomplete state"
, NULL
);
+ php_http_throw(bad_method_call, "Incomplete state");
return;
}
if (info_len && info_name) {
return;
}
if (info_len && info_name) {
- info = zend_read_property(NULL,
info
, php_http_pretty_key(info_name, info_len, 0, 0), info_len, 0, &info_name_tmp);
+ info = zend_read_property(NULL,
Z_OBJ_P(info)
, php_http_pretty_key(info_name, info_len, 0, 0), info_len, 0, &info_name_tmp);
if (!info) {
php_http_throw(unexpected_val, "Could not find transfer info with name '%s'", info_name);
if (!info) {
php_http_throw(unexpected_val, "Could not find transfer info with name '%s'", info_name);
@@
-121,14
+127,12
@@
static zend_function_entry php_http_client_response_methods[] = {
EMPTY_FUNCTION_ENTRY
};
EMPTY_FUNCTION_ENTRY
};
-zend_class_entry *php_http_client_response_class_entry;
-
PHP_MINIT_FUNCTION(http_client_response)
{
zend_class_entry ce = {0};
INIT_NS_CLASS_ENTRY(ce, "http\\Client", "Response", php_http_client_response_methods);
PHP_MINIT_FUNCTION(http_client_response)
{
zend_class_entry ce = {0};
INIT_NS_CLASS_ENTRY(ce, "http\\Client", "Response", php_http_client_response_methods);
- php_http_client_response_class_entry = zend_register_internal_class_ex(&ce, php_http_message_
class_entry
);
+ php_http_client_response_class_entry = zend_register_internal_class_ex(&ce, php_http_message_
get_class_entry()
);
zend_declare_property_null(php_http_client_response_class_entry, ZEND_STRL("transferInfo"), ZEND_ACC_PROTECTED);
zend_declare_property_null(php_http_client_response_class_entry, ZEND_STRL("transferInfo"), ZEND_ACC_PROTECTED);