| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+--------------------------------------------------------------------+
| modification, are permitted provided that the conditions mentioned |
| in the accompanying LICENSE file are met. |
+--------------------------------------------------------------------+
php_stream_filter *this, \
php_stream_bucket_brigade *buckets_in, \
php_stream_bucket_brigade *buckets_out, \
php_stream_filter *this, \
php_stream_bucket_brigade *buckets_in, \
php_stream_bucket_brigade *buckets_out, \
#define PHP_HTTP_FILTER_DTOR(filter) \
http_filter_ ##filter## _dtor
#define PHP_HTTP_FILTER_DESTRUCTOR(filter) \
#define PHP_HTTP_FILTER_DTOR(filter) \
http_filter_ ##filter## _dtor
#define PHP_HTTP_FILTER_DESTRUCTOR(filter) \
- __buck = php_stream_bucket_new(stream, __data, length, 1, this->is_persistent TSRMLS_CC); \
+ __buck = php_stream_bucket_new(stream, __data, length, 1, this->is_persistent); \
/* remove outgoing data from the buffer */
php_http_buffer_cut(PHP_HTTP_BUFFER(buffer), 0, buffer->hexlen);
/* remove outgoing data from the buffer */
php_http_buffer_cut(PHP_HTTP_BUFFER(buffer), 0, buffer->hexlen);
- while (off < PHP_HTTP_BUFFER_LEN(buffer) && (
- PHP_HTTP_BUFFER_VAL(buffer)[off] == '\n' ||
- PHP_HTTP_BUFFER_VAL(buffer)[off] == '\r')) {
+ while (off < PHP_HTTP_BUFFER(buffer)->used && (
+ PHP_HTTP_BUFFER(buffer)->data[off] == '\n' ||
+ PHP_HTTP_BUFFER(buffer)->data[off] == '\r')) {
int eollen;
const char *eolstr;
/* we need eol, so we can be sure we have all hex digits */
php_http_buffer_fix(PHP_HTTP_BUFFER(buffer));
int eollen;
const char *eolstr;
/* we need eol, so we can be sure we have all hex digits */
php_http_buffer_fix(PHP_HTTP_BUFFER(buffer));
- if ((eolstr = php_http_locate_bin_eol(PHP_HTTP_BUFFER_VAL(buffer), PHP_HTTP_BUFFER_LEN(buffer), &eollen))) {
+ if ((eolstr = php_http_locate_bin_eol(PHP_HTTP_BUFFER(buffer)->data, PHP_HTTP_BUFFER(buffer)->used, &eollen))) {
/* if strtoul() stops at the beginning of the buffered data
there's something oddly wrong, i.e. bad input */
/* if strtoul() stops at the beginning of the buffered data
there's something oddly wrong, i.e. bad input */
- php_stream_notify_info(stream->context, PHP_STREAM_NOTIFY_COMPLETED, NULL, 0);
+ php_stream_notify_info(PHP_STREAM_CONTEXT(stream), PHP_STREAM_NOTIFY_COMPLETED, NULL, 0);
php_http_buffer_dtor(PHP_HTTP_BUFFER(b));
pefree(b, this->is_persistent);
php_http_buffer_dtor(PHP_HTTP_BUFFER(b));
pefree(b, this->is_persistent);
}
#if DBG_FILTER
fprintf(stderr, "update: chunked (-> %zu) (w: %zu, r: %zu)\n", ptr->buflen, stream->writepos, stream->readpos);
}
#if DBG_FILTER
fprintf(stderr, "update: chunked (-> %zu) (w: %zu, r: %zu)\n", ptr->buflen, stream->writepos, stream->readpos);
php_http_buffer_appendf(&buf, "%lx" PHP_HTTP_CRLF, (long unsigned int) ptr->buflen);
php_http_buffer_append(&buf, ptr->buf, ptr->buflen);
php_http_buffer_appends(&buf, PHP_HTTP_CRLF);
/* pass through */
php_http_buffer_appendf(&buf, "%lx" PHP_HTTP_CRLF, (long unsigned int) ptr->buflen);
php_http_buffer_append(&buf, ptr->buf, ptr->buflen);
php_http_buffer_appends(&buf, PHP_HTTP_CRLF);
/* pass through */
if (PHP_HTTP_FILTER_IS_CLOSING(stream, flags)) {
#if DBG_FILTER
fprintf(stderr, "finish: chunked\n");
if (PHP_HTTP_FILTER_IS_CLOSING(stream, flags)) {
#if DBG_FILTER
fprintf(stderr, "finish: chunked\n");
static PHP_HTTP_FILTER_FUNCTION(zlib)
{
php_stream_bucket *ptr, *nxt;
static PHP_HTTP_FILTER_FUNCTION(zlib)
{
php_stream_bucket *ptr, *nxt;
#if DBG_FILTER
fprintf(stderr, "bucket: b=%p p=%p p=%p\n", ptr->brigade, ptr->prev, ptr->next);
#if DBG_FILTER
fprintf(stderr, "bucket: b=%p p=%p p=%p\n", ptr->brigade, ptr->prev, ptr->next);
php_http_encoding_stream_update(buffer, ptr->buf, ptr->buflen, &encoded, &encoded_len);
#if DBG_FILTER
php_http_encoding_stream_update(buffer, ptr->buf, ptr->buflen, &encoded, &encoded_len);
#if DBG_FILTER
php_stream_filter *f = NULL;
int flags = p ? PHP_HTTP_ENCODING_STREAM_PERSISTENT : 0;
if (params) {
switch (Z_TYPE_P(params)) {
php_stream_filter *f = NULL;
int flags = p ? PHP_HTTP_ENCODING_STREAM_PERSISTENT : 0;
if (params) {
switch (Z_TYPE_P(params)) {
- case IS_ARRAY:
- case IS_OBJECT:
- if (SUCCESS != zend_hash_find(HASH_OF(params), "flags", sizeof("flags"), (void *) &tmp)) {
- break;
- }
- /* no break */
- default:
- {
- zval *num = php_http_ztyp(IS_LONG, *tmp);
-
- flags |= (Z_LVAL_P(num) & 0x0fffffff);
- zval_ptr_dtor(&num);
-
+ case IS_ARRAY:
+ case IS_OBJECT:
+ if (!(tmp = zend_hash_str_find_ind(HASH_OF(params), ZEND_STRL("flags")))) {
+ break;
if (!strcasecmp(name, "http.inflate")) {
PHP_HTTP_FILTER_BUFFER(zlib) *b = NULL;
if (!strcasecmp(name, "http.inflate")) {
PHP_HTTP_FILTER_BUFFER(zlib) *b = NULL;
- if ((b = php_http_encoding_stream_init(NULL, php_http_encoding_stream_get_inflate_ops(), flags TSRMLS_CC))) {
+ if ((b = php_http_encoding_stream_init(NULL, php_http_encoding_stream_get_inflate_ops(), flags))) {
if (!(f = php_stream_filter_alloc(&PHP_HTTP_FILTER_OP(inflate), b, p))) {
php_http_encoding_stream_free(&b);
}
if (!(f = php_stream_filter_alloc(&PHP_HTTP_FILTER_OP(inflate), b, p))) {
php_http_encoding_stream_free(&b);
}
if (!strcasecmp(name, "http.deflate")) {
PHP_HTTP_FILTER_BUFFER(zlib) *b = NULL;
if (!strcasecmp(name, "http.deflate")) {
PHP_HTTP_FILTER_BUFFER(zlib) *b = NULL;
- if ((b = php_http_encoding_stream_init(NULL, php_http_encoding_stream_get_deflate_ops(), flags TSRMLS_CC))) {
+ if ((b = php_http_encoding_stream_init(NULL, php_http_encoding_stream_get_deflate_ops(), flags))) {
if (!(f = php_stream_filter_alloc(&PHP_HTTP_FILTER_OP(deflate), b, p))) {
php_http_encoding_stream_free(&b);
}
if (!(f = php_stream_filter_alloc(&PHP_HTTP_FILTER_OP(deflate), b, p))) {
php_http_encoding_stream_free(&b);
}