http: general enhancements#731
Conversation
|
Sorry I didn't comment yet. I can look in detail, but currently |
|
Ah, didnt notice that. Seems irrelevant though |
|
Oh, you already fixed, nvm. |
martindurant
left a comment
There was a problem hiding this comment.
I like what's here, but have some comments.
| session = await self.set_session() | ||
| async with session.get(rpath, **self.kwargs) as r: | ||
| try: | ||
| size = int(r.headers["content-length"]) |
There was a problem hiding this comment.
What are the chances of this being wrong due to transfer compression? (_file_info has head["Accept-Encoding"] = "identity")
There was a problem hiding this comment.
Humm, not sure. This seemed like the easiest way to predict the general length, though there might certainly some catches about it. Do you have other suggestions?
There was a problem hiding this comment.
If the purpose is to report on the transfer, then I suppose it's not important - but the number of bytes written to disk won't match. I don't know if aiohttp makes available the actual number of bytes read on the stream before decompression (probably no).
|
Thanks for the review @martindurant, all should be addressed now! |
|
Thanks for making HTTP r/w! Maybe the File object can be made writable too (with the limitation of being able to PUT the file in one call!). We'll see if the file size for the callback ends up being a problem. |
TODO: