set_keepalive returns err “unread data in buffer”
i have a odd issue,i use res:read_body to read all the response body,then use set_keepalive.but its returns error “unread data in buffer”. I try to use res:read_trailers() after res:read_body,but it seams does not work.
Same for me.
same error happens when I use request_uri.
Actually for me the issue is resolved. It was showing this bc connections with timeouts where kept alive instead of closed. After closing every connection that had a timeout the buffers were fine.
Same here.
Same here, but I found the root cause in my case. It is because the value of HTTP header Content-Length in the response is smaller than the actual content length, and I resolve this by closing the connection when set_keepalive fails.
Yes, if you have unread data still on the wire then something seems incorrect with that response (bad Content-Length for example), or you stopped reading prematurely for some other reason. The connection will be in a state which is not safe to reuse.
Hi There,
I've found an issue when the returned result is null with content length of 4. It is easy to reproduce. Seems like the body is not detected properly and then the keepalive fails because there is still data on the wire.. Can someone help in this?
Sure, are you able to post a minimal example that would demonstrate the problem?