Skip to content

_on_chunk_sent at write_eof #2909

Closed
Closed
@vasilenkoalexey

Description

Long story short

Looks like _on_chunk_sent not called when last chunk sent at write_eof

Expected behaviour

_on_chunk_sent called

Actual behaviour

_on_chunk_sent not called

Steps to reproduce

at http_writer.py

async def write(self, chunk, *, drain=True, LIMIT=0x10000):
...
    if self._on_chunk_sent is not None:
        await self._on_chunk_sent(chunk)
...
    if chunk:
        if self.chunked:
            chunk_len = ('%x\r\n' % len(chunk)).encode('ascii')
            chunk = chunk_len + chunk + b'\r\n'

        self._write(chunk)

but

async def write_eof(self, chunk=b''):
...
     if chunk:
         self._write(chunk)

looks like last chunk has been sent and there is not a single call _on_chunk_sent

Your environment

Python 3.6
aiohttp 3.1.1
Windows\Linux

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions