#include <ctype.h>
#include "php.h"
+#include "ext/standard/url.h"
#include "php_http.h"
#include "php_http_std_defs.h"
}
HTTP_KEYLIST_FIXKEY();
-
+
if (first_entry_is_name_value_pair) {
HTTP_KEYLIST_VAL(&array, "name", key, keylen);
}
/* }}} */
-/* {{{ STATUS http_split_response(zval *, zval *, zval *) */
-PHP_HTTP_API STATUS _http_split_response(zval *response, zval *headers, zval *body TSRMLS_DC)
-{
- char *b = NULL;
- size_t l = 0;
- STATUS status = http_split_response_ex(Z_STRVAL_P(response), Z_STRLEN_P(response), Z_ARRVAL_P(headers), &b, &l);
- ZVAL_STRINGL(body, b, l, 0);
- return status;
-}
-/* }}} */
-
/* {{{ STATUS http_split_response(char *, size_t, HashTable *, char **, size_t *) */
-PHP_HTTP_API STATUS _http_split_response_ex(char *response, size_t response_len,
+PHP_HTTP_API STATUS _http_split_response(char *response, size_t response_len,
HashTable *headers, char **body, size_t *body_len TSRMLS_DC)
{
char *header = response, *real_body = NULL;
MAKE_STD_ZVAL(zheaders);
array_init(zheaders);
- if (SUCCESS != http_split_response(zresponse, zheaders, zbody)) {
+ if (SUCCESS != http_split_response(Z_STRVAL_P(zresponse), Z_STRLEN_P(zresponse), Z_ARRVAL_P(zheaders), &Z_STRVAL_P(zbody), &Z_STRLEN_P(zbody))) {
http_error(E_WARNING, HTTP_E_PARSE, "Could not parse HTTP response");
RETURN_FALSE;
}
ZEND_EXTERN_MODULE_GLOBALS(http)
#if LIBCURL_VERSION_NUM < 0x070c00
-# define curl_easy_strerror(code) HTTP_G(request).curl.error
+# define curl_easy_strerror(code) HTTP_G(request).error
#endif
#define HTTP_CURL_INFO(I) HTTP_CURL_INFO_EX(I, I)
#define http_chunked_decode(e, el, d, dl) _http_chunked_decode((e), (el), (d), (dl) TSRMLS_CC)
PHP_HTTP_API const char *_http_chunked_decode(const char *encoded, size_t encoded_len, char **decoded, size_t *decoded_len TSRMLS_DC);
-#define http_split_response(r, h, b) _http_split_response((r), (h), (b) TSRMLS_CC)
-PHP_HTTP_API STATUS _http_split_response(zval *response, zval *headers, zval *body TSRMLS_DC);
-#define http_split_response_ex(r, rl, h, b, bl) _http_split_response_ex((r), (rl), (h), (b), (bl) TSRMLS_CC)
-PHP_HTTP_API STATUS _http_split_response_ex(char *response, size_t repsonse_len, HashTable *headers, char **body, size_t *body_len TSRMLS_DC);
+#define http_split_response(r, rl, h, b, bl) _http_split_response((r), (rl), (h), (b), (bl) TSRMLS_CC)
+PHP_HTTP_API STATUS _http_split_response(char *response, size_t repsonse_len, HashTable *headers, char **body, size_t *body_len TSRMLS_DC);
#endif