Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request Content length is unavailable until after last chunk is received #106

Open
rabeyta opened this issue Jun 26, 2018 · 0 comments
Open

Comments

@rabeyta
Copy link
Contributor

rabeyta commented Jun 26, 2018

Currently, when logging errors around requests not being completed, such as Incomplete Http Call Timeouts, the content length that is logged is always 0.

This is expected behavior based on java docs:

/**
* Returns the total size of the raw content in bytes. This will be 0 until {@link #addContentChunk(HttpContent)}
* detects that the final content chunk has been added, at which point this method will return the number of bytes
* for the request content. You can call {@link #isCompleteRequestWithAllChunks()} to determine whether this method
* is returning 0 because we're waiting on all the content to finish arriving or because the request has no content
* associated with it.
*/
public int getRawContentLengthInBytes();

and implementation at

public synchronized int getRawContentLengthInBytes() {
if (!isCompleteRequestWithAllChunks)
return 0;
return rawContentLengthInBytes;
}

It is coded to return 0 until the request is completed.

Enabling a method to get the current request size in these error scenarios would be helpful and provide insights.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant