Lines Matching refs:stream
71 PHPAPI php_stream_bucket *php_stream_bucket_new(php_stream *stream, char *buf, size_t buflen, uint8… in php_stream_bucket_new() argument
73 int is_persistent = php_stream_is_persistent(stream); in php_stream_bucket_new()
308 php_stream *stream = chain->stream; in php_stream_filter_append_ex() local
320 if (&(stream->readfilters) == chain && (stream->writepos - stream->readpos) > 0) { in php_stream_filter_append_ex()
328 …bucket = php_stream_bucket_new(stream, (char*) stream->readbuf + stream->readpos, stream->writepos… in php_stream_filter_append_ex()
330 status = filter->fops->filter(stream, filter, brig_inp, brig_outp, &consumed, PSFS_FLAG_NORMAL); in php_stream_filter_append_ex()
332 if (stream->readpos + consumed > (uint32_t)stream->writepos) { in php_stream_filter_append_ex()
355 stream->readpos = 0; in php_stream_filter_append_ex()
356 stream->writepos = 0; in php_stream_filter_append_ex()
361 stream->writepos = 0; in php_stream_filter_append_ex()
362 stream->readpos = 0; in php_stream_filter_append_ex()
368 if (stream->readbuflen - stream->writepos < bucket->buflen) { in php_stream_filter_append_ex()
369 stream->readbuflen += bucket->buflen; in php_stream_filter_append_ex()
370 stream->readbuf = perealloc(stream->readbuf, stream->readbuflen, stream->is_persistent); in php_stream_filter_append_ex()
372 memcpy(stream->readbuf + stream->writepos, bucket->buf, bucket->buflen); in php_stream_filter_append_ex()
373 stream->writepos += bucket->buflen; in php_stream_filter_append_ex()
404 php_stream *stream; in _php_stream_filter_flush() local
408 if (!filter->chain || !filter->chain->stream) { in _php_stream_filter_flush()
414 stream = chain->stream; in _php_stream_filter_flush()
419 status = current->fops->filter(stream, current, inp, outp, NULL, flags); in _php_stream_filter_flush()
450 if (chain == &(stream->readfilters)) { in _php_stream_filter_flush()
452 if (stream->readpos > 0) { in _php_stream_filter_flush()
454 memcpy(stream->readbuf, stream->readbuf + stream->readpos, stream->writepos - stream->readpos); in _php_stream_filter_flush()
455 stream->readpos = 0; in _php_stream_filter_flush()
456 stream->writepos -= stream->readpos; in _php_stream_filter_flush()
458 if (flushed_size > (stream->readbuflen - stream->writepos)) { in _php_stream_filter_flush()
460 …stream->readbuf = perealloc(stream->readbuf, stream->writepos + flushed_size + stream->chunk_size,… in _php_stream_filter_flush()
463 memcpy(stream->readbuf + stream->writepos, bucket->buf, bucket->buflen); in _php_stream_filter_flush()
464 stream->writepos += bucket->buflen; in _php_stream_filter_flush()
468 } else if (chain == &(stream->writefilters)) { in _php_stream_filter_flush()
471 ssize_t count = stream->ops->write(stream, bucket->buf, bucket->buflen); in _php_stream_filter_flush()
473 stream->position += count; in _php_stream_filter_flush()