/* proxy */
if ((zoption = get_option(&neon->options.cache, options, ZEND_STRS("proxyhost"), IS_STRING))) {
/* proxy */
if ((zoption = get_option(&neon->options.cache, options, ZEND_STRS("proxyhost"), IS_STRING))) {
- php_http_buffer_appendf(&neon->options.headers, "Range: bytes=%.*s" PHP_HTTP_CRLF, rs.used - 1, rs.data);
+ int used = rs.used > INT_MAX ? INT_MAX : rs.used;
+ php_http_buffer_appendf(&neon->options.headers, "Range: bytes=%.*s" PHP_HTTP_CRLF, used - 1, rs.data);
/* check whether cookies should not be urlencoded; default is to urlencode them */
if ((!(urlenc_cookies = get_option(&neon->options.cache, options, ZEND_STRS("encodecookies"), IS_BOOL))) || Z_BVAL_P(urlenc_cookies)) {
/* check whether cookies should not be urlencoded; default is to urlencode them */
if ((!(urlenc_cookies = get_option(&neon->options.cache, options, ZEND_STRS("encodecookies"), IS_BOOL))) || Z_BVAL_P(urlenc_cookies)) {
- php_http_url_encode_hash_recursive(HASH_OF(zoption), &neon->options.headers, "; ", lenof("; "), NULL, 0 TSRMLS_CC);
+ php_http_url_encode_hash_ex(HASH_OF(zoption), &neon->options.headers, ZEND_STRS("; "), ZEND_STRS("="), NULL, 0 TSRMLS_CC);
php_http_neon_request_reset(h);
php_http_buffer_dtor(&ctx->options.headers);
zend_hash_destroy(&ctx->options.cache);
php_http_neon_request_reset(h);
php_http_buffer_dtor(&ctx->options.headers);
zend_hash_destroy(&ctx->options.cache);
static STATUS php_http_neon_request_reset(php_http_request_t *h)
{
php_http_neon_request_t *neon = h->ctx;
static STATUS php_http_neon_request_reset(php_http_request_t *h)
{
php_http_neon_request_t *neon = h->ctx;
php_http_buffer_reset(&neon->options.headers);
STR_SET(neon->options.useragent, NULL);
php_http_buffer_reset(&neon->options.headers);
STR_SET(neon->options.useragent, NULL);
php_http_error(HE_WARNING, PHP_HTTP_E_REQUEST_METHOD, "Unsupported request method: %d (%s)", meth, url);
return FAILURE;
}
php_http_error(HE_WARNING, PHP_HTTP_E_REQUEST_METHOD, "Unsupported request method: %d (%s)", meth, url);
return FAILURE;
}
static STATUS php_http_neon_request_setopt(php_http_request_t *h, php_http_request_setopt_opt_t opt, void *arg)
{
php_http_neon_request_t *neon = h->ctx;
static STATUS php_http_neon_request_setopt(php_http_request_t *h, php_http_request_setopt_opt_t opt, void *arg)
{
php_http_neon_request_t *neon = h->ctx;