You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes servers send responses without Content-Length and expect the client to consume input (for the body) until EOF. Basically renders recv to return 0 before the parser decides the stream is complete, which will result in an error.
Hi,
I discoverd the same issue while receiving a HTTP 304 response, because the response must not contain a body.
http_date(..) already does recognize responses without Content-Length and sets state http_roundtripper_unknown_data, but the state won't be entered due to while(size){..} and size is 0, even if size==0 is handled in this state.
To work around this issue and be able to enter the state http_roundtripper_unknown_data, I've changed the while statement in http_date(..).
int http_data(struct http_roundtripper* rt, const char* data, int size, int* read)
{
const int initial_size = size;
while ( size
|| (http_roundtripper_unknown_data == rt->state) ) {..}
}
Hi, Thanks for this project!
Sometimes servers send responses without Content-Length and expect the client to consume input (for the body) until EOF. Basically renders
recv
to return0
before the parser decides the stream is complete, which will result in an error.I wonder if this would be resolved by simply return
0
from http_data is the third parameter is passed as0
, i.e. EOF.The text was updated successfully, but these errors were encountered: