Lines Matching refs:this

12 // notice, this list of conditions and the following disclaimer.
14 // copyright notice, this list of conditions and the following disclaimer
19 // this software without specific prior written permission.
59 $this->buffer = $buffer;
60 $this->buffer_size_after_limit = 0;
61 $this->buffer_end = $end;
62 $this->current = $start;
63 $this->current_limit = $end;
64 $this->legitimate_message_end = false;
65 $this->recursion_budget = self::DEFAULT_RECURSION_LIMIT;
66 $this->recursion_limit = self::DEFAULT_RECURSION_LIMIT;
67 $this->total_bytes_limit = self::DEFAULT_TOTAL_BYTES_LIMIT;
68 $this->total_bytes_read = $end - $start;
73 $this->current += $amount;
78 return $this->buffer_end - $this->current;
83 return $this->total_bytes_read -
84 ($this->buffer_end - $this->current +
85 $this->buffer_size_after_limit);
90 return substr($this->buffer, $start, $end - $start);
95 $this->buffer_end += $this->buffer_size_after_limit;
96 $closest_limit = min($this->current_limit, $this->total_bytes_limit);
97 if ($closest_limit < $this->total_bytes_read) {
100 $this->buffer_size_after_limit = $this->total_bytes_read -
102 $this->buffer_end -= $this->buffer_size_after_limit;
104 $this->buffer_size_after_limit = 0;
110 return $this->legitimate_message_end;
120 if (!$this->readVarint64($var)) {
157 if ($this->current === $this->buffer_end) {
163 $b = ord($this->buffer[$this->current]);
168 // $bits is 28 in this case.
175 $this->advance(1);
188 if ($this->current === $this->buffer_end) {
195 $byte = ord($this->buffer[$this->current]);
198 $this->advance(1);
215 if (!$this->readVarint64($var)) {
230 if (!$this->readRaw(4, $data)) {
246 if (!$this->readRaw(4, $data)) {
250 if (!$this->readRaw(4, $data)) {
268 if ($this->current === $this->buffer_end) {
272 $current_position = $this->total_bytes_read -
273 $this->buffer_size_after_limit;
274 if ($current_position >= $this->total_bytes_limit) {
277 $this->legitimate_message_end =
278 ($this->current_limit === $this->total_bytes_limit);
280 $this->legitimate_message_end = true;
287 $success = $this->readVarint32($result);
298 if ($this->bufferSize() < $size) {
305 $buffer = substr($this->buffer, $this->current, $size);
306 $this->advance($size);
313 * from the current position. Once the stream hits this limit, it will act
329 $current_position = $this->current();
330 $old_limit = $this->current_limit;
336 $byte_limit <= $this->current_limit - $current_position) {
337 $this->current_limit = $current_position + $byte_limit;
338 $this->recomputeBufferLimits();
353 $this->current_limit = $byte_limit;
354 $this->recomputeBufferLimits();
357 $this->legitimate_message_end = false;
363 $old_limit = $this->pushLimit($byte_limit);
364 $recursion_limit = --$this->recursion_limit;
369 $result = $this->consumedEntireMessage();
370 $this->popLimit($byte_limit);
371 ++$this->recursion_budget;
377 if ($this->current_limit === PHP_INT_MAX) {
380 return $this->current_limit - $this->current;