NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bozohttp/Lua: Max POST data size



Hi!

I´m trying to send base64 encoded data to a REST service based on
bozohttpd and Lua. The content type is
application/x-www-form-urlencoded and there is only one field called
"DATA". The request begins as below:

--------------------------------------------
POST /print/test HTTP/1.1
User-Agent: curl/7.27.0
Host: myhost
Accept: */*
Content-Length: 981769
Content-Type: application/x-www-form-urlencoded

DATA=JVBERi0xL....
---------------------------------------------


The Lua script looks like this:
-------------------------------------
local httpd = require("httpd")

function test(env, hdr, qry)
      file = io.open("/tmp/request", "w+")

      httpd.print("ENV:")
      for i, j in pairs(env) do
          httpd.print(i .. "\t\t" .. j)
      end

      httpd.print("HDR:")
      for i, j in pairs(hdr) do
          httpd.print(i .. "\t\t" .. j)
      end

      httpd.print("QRY:")
      for i, j in pairs(qry) do
          httpd.print(i .. "\t\t" .. j)
          file:write(j)
      end

      file:close()
end
httpd.register_handler('test', test)
---------------------------------------------------

In this case, the data can not be transferred entirely to the server.
Insted, the server sends the reply too early and only 16KB are written
to the file /tmp/request. So it looks like the POST request is
truncated after 16KB of data for some reason.

I hope someone can help me as to why that is.


Thanks and regards,

Stephan


Home | Main Index | Thread Index | Old Index