diff options
| author | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-09-15 21:10:45 +0200 | 
|---|---|---|
| committer | Fabio Alessandrelli <fabio.alessandrelli@gmail.com> | 2018-09-15 21:17:15 +0200 | 
| commit | 26677d5e0c45d2bcfe6c3dc6661bd2f3b2ee33e9 (patch) | |
| tree | 8b62b09d435046eb44dbe348c8b8b2cf6c16603a /core | |
| parent | 2cf024ed916abf565011b254ea4f69c04781964c (diff) | |
Fix HTTPClient _get_http_data bug after #21976.
Diffstat (limited to 'core')
| -rw-r--r-- | core/io/http_client.cpp | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp index de0b6860f9..80a281a21d 100644 --- a/core/io/http_client.cpp +++ b/core/io/http_client.cpp @@ -668,11 +668,11 @@ Error HTTPClient::_get_http_data(uint8_t *p_buffer, int p_bytes, int &r_received  		// We can't use StreamPeer.get_data, since when reaching EOF we will get an  		// error without knowing how many bytes we received.  		Error err = ERR_FILE_EOF; -		int read; +		int read = 0;  		int left = p_bytes;  		r_received = 0;  		while (left > 0) { -			err = connection->get_partial_data(p_buffer, left, read); +			err = connection->get_partial_data(p_buffer + r_received, left, read);  			if (err == OK) {  				r_received += read;  			} else if (err == ERR_FILE_EOF) {  |