From fbd63a9aea79e08881a4bd37579bacf6d21a901e Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 16 Jun 2022 21:22:51 -0400 Subject: [PATCH 1/2] Doing some tests with ssl --- .gitignore | 3 +++ client.lua | 43 ++++++++++++++++++++++++++++++------------- 2 files changed, 33 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 6fd0a37..f868345 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# lua-env +luajit/* + # Compiled Lua sources luac.out diff --git a/client.lua b/client.lua index 1c860c5..8ee11fa 100644 --- a/client.lua +++ b/client.lua @@ -2,20 +2,36 @@ package.path = "./?/init.lua;./?.lua;"..package.path local net = require("lnet.tcp") local multi, thread = require("multi"):init() -local http = require("lnet.http") +-- local http = require("lnet.http") +-- local http_ = require("socket.http") -multi:newThread("Download Test",function() - local data = http.request("http://zjcdn.mangafox.me/store/manga/14765/01-001.0/compressed/t001.jpg") - local file = io.open("test.jpg","wb") - file:write(data) - file:flush() - file:close() - os.exit() -end) +-- download = thread:newFunction(function(url,fn) +-- print(1) +-- local t = multi:newTimer() +-- print(2) +-- t:Start() +-- print(3,url) +-- local data,b = http.request(url) +-- print(data,b) +-- local file = io.open(fn,"wb") +-- print(5) +-- file:write(data) +-- print(6) +-- file:flush() +-- print(7) +-- file:close() +-- print(fn.." Finished downloading: ".. t:Get()) +-- end) + +-- multi:newThread("Timer",function() +-- while true do +-- thread.sleep(8) +-- print("...") +-- end +-- end) +--download("http://212.183.159.230/5MB.zip","test1.bin") +--download("http://212.183.159.230/50MB.zip","test2.bin").OnError(print) -multi:newThread("Timer",function() - -end) -- local client = net.newCastedClient("Test")--net:newTCPClient("localhost",12345) -- client:send("Test!") @@ -23,4 +39,5 @@ end) -- client.OnDataRecieved(function(c,data) -- print("Response: ",data) -- end) -multi:mainloop() \ No newline at end of file + +--multi:mainloop() \ No newline at end of file From b7636e977d6d3926052b32a072db7fab929bf294 Mon Sep 17 00:00:00 2001 From: Ryan Ward Date: Thu, 16 Jun 2022 21:32:13 -0400 Subject: [PATCH 2/2] testing --- client.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client.lua b/client.lua index 8ee11fa..23ee7e2 100644 --- a/client.lua +++ b/client.lua @@ -1,7 +1,7 @@ package.path = "./?/init.lua;./?.lua;"..package.path local net = require("lnet.tcp") local multi, thread = require("multi"):init() - +-- -- local http = require("lnet.http") -- local http_ = require("socket.http") @@ -40,4 +40,4 @@ local multi, thread = require("multi"):init() -- print("Response: ",data) -- end) ---multi:mainloop() \ No newline at end of file +--multi:mainloop()