merge conflicts

This commit is contained in:
Ryan Ward 2023-06-27 22:52:56 -04:00
commit eb6c7ba651
2 changed files with 15 additions and 32 deletions

3
.gitignore vendored
View File

@ -1,3 +1,6 @@
# lua-env
luajit/*
# Compiled Lua sources # Compiled Lua sources
luac.out luac.out

View File

@ -1,41 +1,20 @@
package.path = "./?/init.lua;./?.lua;"..package.path package.path = "./?/init.lua;./?.lua;"..package.path
local net = require("lnet.tcp") local net = require("lnet.tcp")
local multi, thread = require("multi"):init() local multi, thread = require("multi"):init()
--
-- local http = require("lnet.http")
-- local http_ = require("socket.http")
local http = require("lnet.http") local http = require("lnet.http")
--local https = require("lnet.https")
local https = require("ssl.https")
-- multi:newThread("Download Test",function() -- multi:newThread("Timer",function()
-- http.request:holdMe(false) -- Gain Access to the return manager -- while true do
-- local data = http.request { -- thread.sleep(8)
-- url = "http://files.luaforge.net/releases/luaforwindows/luaforwindows/5.1.4-35/LuaForWindows_v5.1.4-35.exe", -- print("...")
-- sink = ltn12.sink.file(io.open("test.exe","wb"))
-- }
-- local t={}
-- data.OnStatus(function(part,whole)
-- local per = math.ceil((part/whole)*100)
-- if not t[per] then
-- print("T1",per)
-- t[per] = true
-- end -- end
-- end) -- end)
-- local c = os.clock() --download("http://212.183.159.230/5MB.zip","test1.bin")
-- thread.hold(data.connect()) --download("http://212.183.159.230/50MB.zip","test2.bin").OnError(print)
-- print("Done!",os.clock()-c)
-- end)
multi:newThread("Download Test 2",function()--https://erowall.com/download_img.php?dimg=16911&raz=2560x1600
local data,err = https.request("https://erowall.com/download_img.php?dimg=16911&raz=2560x1600")
local file = io.open("test.jpg","wb")
file:write(data)
file:flush()
file:close()
print("Done!")
os.exit()
end).OnError(function(self,err)
print(">>",err)
end)
-- local client = net.newCastedClient("Test")--net:newTCPClient("localhost",12345) -- local client = net.newCastedClient("Test")--net:newTCPClient("localhost",12345)
@ -44,4 +23,5 @@ end)
-- client.OnDataRecieved(function(c,data) -- client.OnDataRecieved(function(c,data)
-- print("Response: ",data) -- print("Response: ",data)
-- end) -- end)
multi:mainloop()
--multi:mainloop()