Replies: 4 comments 4 replies
-
|
Hi, |
Beta Was this translation helpful? Give feedback.
-
|
I am not sure we have a use case for 1) ? If the content lengrh is not know in theory we need the corresponding chunk encoding header right ? |
Beta Was this translation helpful? Give feedback.
-
|
I'm not sure if 1) is actually used in current lib classes, I guess not :) But it's a completely valid case at least for HTTP 1.0 and probably for HTTP1.1 also (need to check). If server sends reply with a body but without content-length header then it must set |
Beta Was this translation helpful? Give feedback.
-
|
checked the code, templated response does use chunked indeed, so should be OK.
no, the idea is that if alloc fails then this method would just break and exit, then it might retry later on next tcp_recv on poll, so there is no need to abort the connection abnormally. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi team,
@mathieucarbou, @willmmiles, @me-no-dev
let's discuss what are we gonna do with this further
As I see the root cause was actually in
AsyncJsonandChunkPrintclasses, other code like file or static strings response was not impacted. But the expected behavior for_fillBiffercalls is now unclear and undocumented.Now we have a forked scenarios - for chunked responses
_fillBifferreceives just the buffer and it's up to the derived class to track the amount of data it intends to write, and for non-chunked we act under assumption thatcontentLengthis known and set and it is up toAsyncAbstractResponseto keep track of transferred data and limit buffer space. So I have two concerns:contentLengthis unknown but response is NOT chunkedcontentLengthat allI do fully understand that it's an old design with all pros' and con's but templating implementation embedded in a way like today does complicate things and makes adopting design changes not that easy.
Beta Was this translation helpful? Give feedback.
All reactions