Skip to content

ContentLength can go over 2 byte int #90

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

Merged
merged 2 commits into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/HttpClient.cpp
Original file line number Diff line number Diff line change
@@ -542,7 +542,7 @@ bool HttpClient::endOfHeadersReached()
return (iState == eReadingBody || iState == eReadingChunkLength || iState == eReadingBodyChunk);
};

int HttpClient::contentLength()
long HttpClient::contentLength()
{
// skip the response headers, if they haven't been read already
if (!endOfHeadersReached())
4 changes: 2 additions & 2 deletions src/HttpClient.h
Original file line number Diff line number Diff line change
@@ -272,7 +272,7 @@ class HttpClient : public Client
@return Length of the body, in bytes, or kNoContentLengthHeader if no
Content-Length header was returned by the server
*/
int contentLength();
long contentLength();

/** Returns if the response body is chunked
@return true if response body is chunked, false otherwise
@@ -372,7 +372,7 @@ class HttpClient : public Client
// Stores the status code for the response, once known
int iStatusCode;
// Stores the value of the Content-Length header, if present
int iContentLength;
long iContentLength;
// How many bytes of the response body have been read by the user
int iBodyLengthConsumed;
// How far through a Content-Length header prefix we are