mirror of
https://github.com/lammertb/libhttp.git
synced 2025-12-23 15:42:08 +03:00
@@ -72,7 +72,14 @@ if method=="PUT" then
|
||||
mg.write("<body>Resource of type \"" .. mime .. "\" already exists.</body></html>\r\n")
|
||||
else
|
||||
local f = io.open(file, "w")
|
||||
f:write(mg.read())
|
||||
|
||||
local data = {}
|
||||
repeat
|
||||
local l = mg.read();
|
||||
data[#data+1] = l;
|
||||
until ((l == "") or (l == nil));
|
||||
|
||||
f:write(table.concat(data, ""))
|
||||
f:close()
|
||||
mg.write("HTTP/1.0 200 OK\r\n")
|
||||
mg.write("Connection: close\r\n")
|
||||
|
||||
@@ -32,7 +32,7 @@ unsigned short PORT = 8080;
|
||||
const char * RESOURCE = "/resource_script_demo.lua/r1.txt";
|
||||
const char * METHOD = "PUT";
|
||||
|
||||
unsigned postSize = 987;
|
||||
unsigned postSize = 9876;
|
||||
unsigned extraHeadSize = 0;
|
||||
unsigned queryStringSize = 0;
|
||||
int keep_alive = 0;
|
||||
|
||||
Reference in New Issue
Block a user