summaryrefslogtreecommitdiff
path: root/core/io
diff options
context:
space:
mode:
Diffstat (limited to 'core/io')
-rw-r--r--core/io/http_client.cpp6
-rw-r--r--core/io/json.cpp4
2 files changed, 6 insertions, 4 deletions
diff --git a/core/io/http_client.cpp b/core/io/http_client.cpp
index 63c8abbbad..fd06d27c1f 100644
--- a/core/io/http_client.cpp
+++ b/core/io/http_client.cpp
@@ -566,11 +566,13 @@ PoolByteArray HTTPClient::read_response_body_chunk() {
int to_read = MIN(body_left,read_chunk_size);
PoolByteArray ret;
ret.resize(to_read);
- PoolByteArray::Write w = ret.write();
int _offset = 0;
while (to_read > 0) {
int rec=0;
- err = _get_http_data(w.ptr()+_offset,to_read,rec);
+ {
+ PoolByteArray::Write w = ret.write();
+ err = _get_http_data(w.ptr()+_offset,to_read,rec);
+ }
if (rec>0) {
body_left-=rec;
to_read-=rec;
diff --git a/core/io/json.cpp b/core/io/json.cpp
index ac5b8f1e5f..5ade25aab4 100644
--- a/core/io/json.cpp
+++ b/core/io/json.cpp
@@ -374,7 +374,7 @@ Error JSON::_parse_array(Array &array,const CharType *p_str,int &index, int p_le
}
- return OK;
+ return ERR_PARSE_ERROR;
}
@@ -446,7 +446,7 @@ Error JSON::_parse_object(Dictionary &object,const CharType *p_str,int &index, i
}
}
- return OK;
+ return ERR_PARSE_ERROR;
}