mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-19 04:06:43 -04:00
Properly closing HTTP requests on errors in iterator.
This commit is contained in:
parent
644bb3e705
commit
29cbfb529e
@ -38,10 +38,10 @@ function internet.request(url, data)
|
||||
while true do
|
||||
local data, reason = inet.read(handle.value)
|
||||
if not data then
|
||||
inet.close(handle.value)
|
||||
if reason then
|
||||
error(reason, 2)
|
||||
else
|
||||
inet.close(handle.value)
|
||||
return nil -- eof
|
||||
end
|
||||
elseif #data > 0 then
|
||||
|
Loading…
x
Reference in New Issue
Block a user