Fix NativeHTTPRequest.loadText
Followup to these two commits:02617a854dad3a632927In the second commit, the buildBuffer call in HTTPRequest was found to conflict with the way local requests are made, with the bytes being set directly. So buildBuffer was moved to NativeHTTPRequest instead. Upon promise completion, now, the value of bytes should always be correct, and buildBuffer need not be called. But buildBuffer is called again in NativeHTTPRequest.loadText. For local requests, this will lead to the same problem that the second commit fixed (presumably), and for network requests, this leads to the nulled out buffer being accessed a second time, resulting in a crash. So since the received value of bytes is already correct and buildBuffer is harmful, the buildBuffer call is removed from loadText. Both local and network requests are happy now!
This commit is contained in:
@@ -349,7 +349,6 @@ class NativeHTTPRequest
|
||||
|
||||
future.onComplete(function(bytes)
|
||||
{
|
||||
bytes = buildBuffer();
|
||||
if (bytes == null)
|
||||
{
|
||||
promise.complete(null);
|
||||
|
||||
Reference in New Issue
Block a user