equal
deleted
inserted
replaced
529 # * If a chunk can be buffered without total buffered size limits |
529 # * If a chunk can be buffered without total buffered size limits |
530 # being exceeded, we do that. |
530 # being exceeded, we do that. |
531 # * If a chunk causes us to go over our buffering limit, we flush |
531 # * If a chunk causes us to go over our buffering limit, we flush |
532 # and then buffer the new chunk. |
532 # and then buffer the new chunk. |
533 |
533 |
|
534 if not data: |
|
535 return |
|
536 |
534 if len(data) > self._maxsize: |
537 if len(data) > self._maxsize: |
535 for frame in self._flush(): |
538 for frame in self._flush(): |
536 yield frame |
539 yield frame |
537 |
540 |
538 # Now emit frames for the big chunk. |
541 # Now emit frames for the big chunk. |
570 payload = b''.join(self._chunks) |
573 payload = b''.join(self._chunks) |
571 assert len(payload) <= self._maxsize |
574 assert len(payload) <= self._maxsize |
572 |
575 |
573 self._chunks[:] = [] |
576 self._chunks[:] = [] |
574 self._chunkssize = 0 |
577 self._chunkssize = 0 |
|
578 |
|
579 if not payload: |
|
580 return |
575 |
581 |
576 yield self._stream.makeframe( |
582 yield self._stream.makeframe( |
577 self._requestid, |
583 self._requestid, |
578 typeid=FRAME_TYPE_COMMAND_RESPONSE, |
584 typeid=FRAME_TYPE_COMMAND_RESPONSE, |
579 flags=FLAG_COMMAND_RESPONSE_CONTINUATION, |
585 flags=FLAG_COMMAND_RESPONSE_CONTINUATION, |